ack
ack copied to clipboard
Basic: read out of data issue
Consider below basic code:
' test.bas
10 read x
20 read y
30 data 2, 3
40 print x, y
Build with:
ack -O test.bas -o test
./test
the output is:
LINE 20:ERROR 2: Out of data
expect output should be:
2 3
Gosh, the Basic compiler! That's... obscure...
The Basic dialect is pretty weird. Looking at the documentation (http://tack.sourceforge.net/olddocs/basic.html#2.3.%20DATA) it appears that DATA values are written to an external file which then needs to be accessible at run time --- is it?