The LOCAL example seems broken, at least if the intention is to have it behave the same as the 'local' keyword in any other language.
The 'parameter' to GETDATAFROM does not look like a label (no @) - it's best not to introduce inconsistency. Also, RESTORE can take a string value, GETDATAFROM looks like it will be less useful because it can't.
SmileBASIC Simplification Protocol Example replacement
Root / Talk About Programs / [.]
chemicalexCreated:
So the main point of SBSP is to make smileBASIC simpler to write. I'm going to give some example code and what it sets to, so give feedback for what you think positively and negatively.
SBSP:
FOR I=0,100 DO PRINT I NEXTSmileBASIC:
FOR I=0 TO 100 PRINT I NEXTSBSP:
QUERY"What is your name?";ANS$SmileBASIC:
LINPUT"What is your name?";ANS$SBSP:
LOCAL VAR=10.5SmileBASIC:
LOC_VAR=10.5SBSP:
GETDATFROM FINDDATA READ A$ PRINT A$ @FINDDATA DAT"Hello World!"SmileBASIC:
RESTORE @FINDDATA READ A$ PRINT A$ @FINDDATA DATA "Hello World!"
The LOCAL example seems broken, at least if the intention is to have it behave the same as the 'local' keyword in any other language. The 'parameter' to GETDATAFROM does not look like a label (no @) - it's best not to introduce inconsistency. Also, RESTORE can take a string value, GETDATAFROM looks like it will be less useful because it can't.The name GETDATFROM it supposed to GET DATA FROM a loop. Also it converts things like GETDATFROM @LOOP and changes it to the version explained above, and converts it BACK so either way would be fine. But thanks for your criticism!
RESTORE is obsolete (because of COPY).I used RESTORE about 4 times in the N# compiler ;-;
Trying to figure out the for each loop end, lolI use restore A LOT. If copy can't handle 2 dimensional arrays, then I won't use it, but I don't really know. On SBSP: Looks cool, will there be it's own custom commands too or just 'simplified' stuff?RESTORE is obsolete (because of COPY).I used RESTORE about 4 times in the N# compiler ;-;