LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

ELSE Syntax Error

Root / SmileBASIC Bug Reports / [.]

MZ952Created:
I'm not sure of this is a true error, but this error does not occur with any other phrase other than theELSE's.
IF X THEN INC X,5UNSHIFT Y$,"A"
Perfectly legal, executable code. You do not need to include the space (or colon) after the number 5 because the parser handles it.
IF X THEN INC X,5ELSE UNSHIFT Y$,"A"
SYNTAX ERROR The phrase ELSE is not even highlighted. Same goes for ELSEIF. Not sure if this could truly be classified as a bug, but it would seem to go against my preconceived notions of SB syntax highlighting, and SB syntax in general.

This isn't a bug. E's are weird in SmileBASIC's code. The "E" in "ELSE" changes the format of the "5".

It's because when an E is after a number, it expects another number after the E, like 1E5 (10000), 1.5E-3 (.0015), 1.1E+2(110), etc. What they should've done is just not group the E with the number when it's invalid, but I guess they expected people to always use colons to separate lines of code.

I've always seen people use that sort of scientific notation when writing example code here. I thought it was just a human, short hand notation, not an actual SB syntax supported function. That's really interesting to know.