? ELSE Syntax Error (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Creep into the Halloween / Horror Programming Contest (Deadline Extended)

ELSE Syntax Error

  • #1 ✎ 108 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies 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. Posted
  • #2 ✎ 141 Nathaniel Spring 2017 Contest Winner I won the SmileBASIC Source Spring 2017 Contest! Programming Contest Helper Received for being very helpful around SmileBASIC Source Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements This isn't a bug. E's are weird in SmileBASIC's code. The "E" in "ELSE" changes the format of the "5". Posted
  • #3 ✎ 1261 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS 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. Posted Edited by 12Me21
  • #4 ✎ 108 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies 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. Posted