Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Must an extra value be provided on DATA statement?
#11
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.
Reply
#12
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Seeking Matches in a Data Base Dimster 10 1,028 07-13-2025, 12:26 AM
Last Post: Dimster
  _Glue statement coming anytime soon? Pete 7 1,288 04-13-2025, 10:56 PM
Last Post: eoredson
  Change file data krovit 5 1,186 07-11-2024, 07:45 AM
Last Post: krovit
  The Width statement eoredson 15 2,258 04-06-2024, 03:57 AM
Last Post: Pete
  Arrays In User Data Types Consolemu 2 859 01-18-2024, 09:49 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)