VSCode plugin generates errors for SPRITE OVER statements
paulossilva opened this issue Β· comments
Using the NextBASIC VSCode plugin, errors in BASIC are reported by the interpreter when a SPRITE OVER statement is assigned to an integer variable AND its second parameter is greater than 32.
How to reproduce this error:
- Run the following code from the plugin:
#program test
#autoline 1,1
#autostart
PROC test()
STOP
DEFPROC test()
local %a
LET %a=% SPRITE OVER (0,35,1,1)
IF %a=0 THEN PRINT "0": ELSE PRINT "1"
PAUSE 0
ENDPROC
- Run it on CSpect (you can also try to run it on a real machine)
- The emulator will show Next's start menu
- Select NextBASIC
- Type RUN
- An error will appear (it depends on the value of the second parameter passed to SPRITE OVER)
- Make any simple edit on LINE 5
- Run the program again
- Now it runs fine!
It seems the plugin is generating some bad token for line 5 as editing it in the native editor makes the error to go away.
I have tried this in CSpect V.2.12.30 and on a real machine both running ZXNextOS 2.06K and got the exact same result.
Yet, values lower or equal to 32 seem to not cause this behaviour. I have also tested this using a range for the second parameter, like 1 TO 50.
Finally, I have moved the text file to the real machine and used the native .txt2bas, which resulted in a flawlessly running code.
Definitely sounds like an encoding error in my txt2bas. I'll try to get it fixed this morning and push a release.
Thank you for a great example of how to replicate π
π This issue has been resolved in version 1.12.10 π
The release is available on:
Your semantic-release bot π¦π
That's been fixed and the update to the vscode plugin is being published - it should be live in the next few minutes or so. Thanks again.