What IF ,Then What?

Blitz3D Forums/Blitz3D Beginners Area/What IF ,Then What?

This is a simple example. It only proves 2 ways of doing the same thing.

If A=5
B = 10
Endif

If A=5 then B = 10 ;no need for endif

If I understand this correclty this is the same thing. And the use of THEN makes it possible to write it on the same line. true?



Absolutely true. But the multi-line version is far easier to read. It indents the conditional statement, which will makes things a lot easier when you're debugging. You'll go past the single line version 3 or 4 times looking for it. It's just personal preference. Whatever you find easiest to read and debug is just fine.

Since there's no such thing as a single line assembly language equivalent, I can't imagine that the resulting code will be different.