Programming Manual for Citizen BASIC Interpreter - MaRCo
Programming Manual for Citizen BASIC Interpreter - MaRCo
Programming Manual for Citizen BASIC Interpreter - MaRCo
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Citizen</strong> <strong>BASIC</strong> <strong>Interpreter</strong><br />
>RUN<br />
1 2<br />
3 4<br />
5 6<br />
7 8<br />
9 10<br />
Ready<br />
3.13.4 DATA Statement<br />
【Explanation】<br />
This statement defines the data to read to the variable by the READ statement.<br />
【Format】<br />
DATA data ・・・<br />
【Parameter】<br />
Data: defines the numeric constant or the string constant. The value defined here<br />
is read to the variable of the READ statement. The data type must correspond to<br />
the variable type of the READ statement.<br />
【E.g.】<br />
>LIST<br />
1000 WHILE 1<br />
1010 READ A,B$<br />
1020 IF A=9999 THEN EXIT<br />
1030 PRINT A;"-";B$<br />
1040 WEND<br />
1050 END<br />
1060 DATA 1,"PEN"<br />
1070 DATA 2,"DESK"<br />
1080 DATA 3,"NOTE"<br />
1090 DATA 9999,""<br />
Ready<br />
>RUN<br />
1-PEN<br />
2-DESK<br />
3-NOTE<br />
Ready<br />
3.13.5 RESTORE Statement<br />
【Explanation】<br />
This statement designates the position of the DATA statement to read by the READ<br />
statement.<br />
【Format】<br />
RESTORE [line number]<br />
【Parameter】<br />
Line number:<br />
Designates the line number of the DATA to start reading<br />
Omission of the line number starts reading from the initial<br />
DATA statement.<br />
【E.g.】<br />
>LIST<br />
1000 DIM A$(5),B$(5)<br />
1010 FOR C=1 TO 5<br />
1020 READ A$(C)<br />
1030 NEXT C<br />
1040 RESTORE<br />
1050 FOR C=1 TO 5<br />
40