May 14, 2024, 08:38:07 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Obscure bug with ELSEIF

Started by Parker, November 24, 2008, 10:50:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

Try the following code:
int i = 1
if i = 1
print "1"
elseif i=2
print "2"
if i=1
endif
else
print "4"
endif


If there is an IF statement inside of any of the ELSEIF branches, it will automatically jump to the ELSE branch. For example, this code prints "1" and then "4". For the moment I've switched over to SELECT/CASE so it's not really crucial, but it shouldn't behave like that is all... thanks.

Ionic Wind Support Team

Ionic Wind Support Team