Oh, wow, I didn't realize that other slots don't have their own global variable pool. Sorry I posted under the assumption that they did. I wrote a quick test and my eyes got really big (in surprise, not delight).
YUCK.
Fire up the way-way-back machine. This is programming the way it was before OOP. SmileBASIC does have user-defined functions with parameters and local (temporary) variables, which is a huge improvement over early BASIC. But there are no structs or classes. No local persistent state. Only global variables are persistent.
I had my own program in slot 0 and the button testing program above in slot 1. As far as I know, the START button always runs the program in slot 0. So I was using the command RUN 1 in direct mode to start the button testing program. Sorry to complicate things with all that detail! 8D
The reason why my example tests for button release first is because I was running the program with the RUN command in direct mode (pressing "A" to enter the command) and the "A" button was still pressed when the program started (because SmileBASIC is so fast).
There are a couple of problems with Javo's example. First, it tests BT before setting it. Secondly, more than one button can be pressed, which would cause the test to fail since BT would not equal #A.
To save yourself some typing, if you are already in the editor, you can hold down one of the shoulder buttons (L or R) and tap the LOAD button at the top. That will open a dialog which lets you choose the file to load. You can use the arrow at the top of the dialog to go up a level and choose a different folder to browse. Super EZ PZ. 8D
Line 33 just means it hit the end of the program without finding a NEXT. The line number is useless. You have to find the problem yourself. Looks like you are also missing an END for that DEF.