I've simplified your test case. Your code is causing a problem because you're calling a function with two arguments.
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.
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.