iCon
Newish
Posts: 20
|
Post by iCon on Jan 22, 2012 20:51:13 GMT -5
For some reason in one of my programs, I have to have multiple endifs for it to work. This is the problem in short;
while true
if condition = true then
else if thiscondition = true then
else if thatcondition = trute
else
endif endif endif
wend
If I remove a single endif, the program says "wend without while" Isn't only one endif required?
|
|
|
Post by matthew on Jan 23, 2012 5:09:39 GMT -5
No in Basic4GL every If Block must be accompanied by an Endif. Take a look in the Basic4GL Language Guide for more information.
|
|
|
Post by DJLinux on Jan 24, 2012 0:46:24 GMT -5
@icon in this case: "else if" should be "elseif" (without the space betwen else and if) Joshy like this: dim condition,thiscondition=true,thatcondition while true if condition = true then printr "condition=true" elseif thiscondition = true then printr "thiscondition=true" elseif thatcondition = true then printr "thatcondition=true" else printr "all conditions are false" endif sleep(1000) wend or do you mean this ? dim condition,thiscondition=true,thatcondition while true if condition = true then printr "condition=true" else if thiscondition = true then printr "thiscondition=true" else if thatcondition = true then printr "thatcondition=true" else printr "all conditions are false" end if end if end if sleep(1000) wend
|
|
iCon
Newish
Posts: 20
|
Post by iCon on Jan 24, 2012 4:47:48 GMT -5
Turns out I did leave a space between else and if. This is for the main animation loop for a basic sprite program.
|
|