09-30-2025, 05:38 PM
(09-30-2025, 07:55 AM)hsiangch_ong Wrote: lol at "demonstrate defect in data handling." the "defect" is actually expected. by quite a few programs. written for quickbasic 4.5 and for qbasic for ms-dos, for starters. the freedom to compose data statements. was perhaps taken for granted. from "basica" interpreter for example.
it might be better. to read in all the numbers as strings. then a sentinel like "END" could have been chosen. i use data and read for simple programs. otherwise using input files is just better.
I use DATA quite a bit in 8 bit programs to hold Machine Language subroutines to POKE into memory. POKE values are ALWAYS positive from 0 to 255 so I always terminate the DATA values with -1 . That way If I modify the assembly sub routine I can just paste in the new object code and don't have to hard code the NUMBER of bytes. -1 will NEVER be in the values I'm poking. Something similiar could be used anywhere. Just a value that is far outside the normal range of the DATA you expect.

