The Amazing Screen Saver

Miscellaneous Forums/Blitz Showcase/The Amazing Screen Saver

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

"Interesting comment about the colons. I've always understood in other BASICs that colons form a compound statement"

I think that is unintuitive. I understood them to be line breaks. One does not look at an if statement and think "If that is true, then execute everthing on the line after this."

What if I do this?

If A = 5 B = 10 : C = 11
D = 12
EndIf

Will that work? I don't know. Hell, having a Then doesn't even mean that it's a one line statement in Blitz does it?

Doing a little investigating I find that the above will not work. The way IF works in Blitz is if there is anything on the line after the if condition, (other than a comment) it does not look for additional statements on the next few lines, and it does not look for an endif. So an endif there would generate an error.

Personally, I think that : should be a line break, and you should only be allowed to have "then" when there is only one statement on the line after the IF. If you want to have multiple commands run from an IF on the same line, then the format would be like so:

If A = 0 : B = 1 : C = 2 : EndIF


And these would be the two other valid formats:

If A = 0 Then B = 1

If A = 0
B = 1
C = 2
EndIf


These would be wrong:

If A = 0 Then B = 1 : C = 2

Result:
C = 2 regardless of whether A = 0 or not. C = 2 executed as if it is on the next line.


My way's better. :-) And the proof? The fact that you cannot make a single line program easily with the way Blitz works. As soon as you have an IF statement, you're screwed and have to move on to the next line, because with Blitz's way everything after that IF would become part of that IF statement.