DATA statement vs. line number conflict

From Liberty BASIC Family
Jump to navigation Jump to search

Description

If the DATA statement is preceded by a line number, it will compile to a .tkn, but resulting TKN file will fail when executed.

Example code to demonstrate the bug.

'This will fail to run as a .tkn
100 DIM d(6)
200 FOR n = 1 to 6
210 READ d
220 d(n)=d
230 NEXT
240 END

250 DATA 1,2,3
260 DATA 1,2,3

Example code to work around the bug.

' This will run even as a .tkn
100 DIM d(6)
200 FOR n = 1 to 6
210 READ d
220 d(n)=d
230 NEXT
240 END

DATA 1,2,3
DATA 1,2,3