If ... Then func() Else ...

Blitz3D Forums/Blitz3D Bug Reports/If ... Then func() Else ...

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.

I've simplified your test case. Your code is causing a problem because you're calling a function with two arguments.

If blah Then bar() Else Print ; Expecting Expression
If blah Then bar(1) Else Print ; works fine!
If blah Then bar(1,2) Else Print ; Expecting ')'
If blah Then bar(1,2,3) Else Print ; Expecting ')'
If blah Then bar(1,2,3,4) Else Print ; Expecting ')'
If blah Then bar(1,2,3,4,5) Else Print ; Expecting ')'

Function bar(x1=0,x2=0,x3=0,x4=0,x5=0)
End Function


As illustrated above, the Blitz3d parser chokes on single-line IF..THEN..ELSE statements where the THEN substatement is a function call with (a) any number of parameters other than one and (b) an ignored return value.