Simpless question

Blitz3D Forums/Blitz3D Beginners Area/Simpless question

Apollonius(Posted 2003) [#1]
I do this:
If Frames = 22 Then Frames = 12

Can I do this instead?
If (Frames = 22) Then (Frames = 12)


Simpless question uh :)


JazzieB(Posted 2003) [#2]
In short, no!

You can have brackets as part of the If part, as this is seen as a formula or condition that should return True or False.

You get an 'Expecting End Of Line' error when the compiler gets to the Then part, as it thinks that bit in brackets is also a condition, which cannot be used as you're doing there.


Apollonius(Posted 2003) [#3]
ah thats sad... its easyer to read


CS_TBL(Posted 2003) [#4]
you can skip the 'then' ... maybe that's easier to read?

so:

a=1

if a b()

function b()
..
end function

means that in this case the function is called.. boolean stuff tho..

for detailed IF's:
if a was 4 then you could do: "if a=4 b()"


Apollonius(Posted 2003) [#5]
actually makes it a bit better to read lol