? Labels and compilation error bug thing (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Labels and compilation error bug thing

  • #1 ✎ 1465 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website Step 1: run this in slot 0 @A PRINT "Hi" Step 2: run this in slot 0@[email protected]'something that contains the previous label and causes a syntax error Step 3: run this in direct mode: GOTO @A It will print "Hi". Apparently you can use this to crash SB somehow. Posted
  • #2 ✎ 474 SquareFingers For more explicit instructions: Step 1: Run this in slot 0: @A B$="Hi":PRINT B$It runs fine. Step 2: Run this in slot 0: @[email protected]$="Hi":PRINT B$It generates a Syntax Error. Step 3: Run this in direct mode: GOTO @AThe 'direct mode' cursor stops blinking for a couple of seconds. The system shows "An error has occurred, forcing the software to close. The system will now restart. (Unsaved data may be lost.)". Not every syntax-error-causing code in step 2 will cause this. New 3DS, SmileBasic 3.3.2. Posted Edited by SquareFingers
  • #3 ✎ 1465 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website maybe it's because the second program creates another variable B$ and the first one tries to access it... or something. Posted
  • #4 ✎ 44 CyberYoshi64 Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I tried it myself and this is the result: (? / PRINT) B$ doesn't matter here. This can be omitted. I think SB gets confused rather if @B$ is a label or a variable and (, what SB always does,) crashes. (It doesn't matter if B$ got something in the 1st place. I tried it after SB crashed and the results were the same.) Old 2DS, SmileBASIC EUR 3.5.2 It turns out the "$" sign is placed in a way where SB gets confused whether "@$" is a label or a string variable. Leaving @ and/or $ alone without alphanumerical symbols, will end up crashing SB, once you run the program and come to that point in direct mode like: >=Input [Blank]=Output OK >RUN 'or pressing START/SELECT Syntax Error in 0:1 >GOTO @A Posted Edited by CyberYoshi64