Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this a bug?
#7
(05-16-2024, 09:57 PM)grymmjack Wrote: I ran into this too.

Code: (Select All)
DATA 9: ' (yep)

Exactly Smile

The IDE didn't catch it then either.

The IDE can't catch it, as it's not a glitch.

For example, let's take a look at this person in my address book:

Code: (Select All)
DATA John, Doe, 123, 49er's Street, New York, New York, 12345
Now, that data represents:
First name -- string
Last name -- string
House/Apt number -- number
Street name -- string
City name -- string
State name -- string
Zip code -- number

Now, which of the next two statements do you support as being true:

1) That's correct DATA as written and will process in the proper fields with zero issues.

or

2) That's only half the data, as that ' is a remark and everything after it doesn't count as data, therefore it's going to error out when being read.


Note that BASIC wouldn't have this issue, if DATA strings had the same rules as everything else in the language -- they had to be INSIDE QUOTES!!   Unfortunately, in an attempt to save as much byte size, disk space, and memory, as possible back in the day, DATA doesn't require strings to be in quotes.

And that's where this "glitch" tends to pop up and catch folks unaware who aren't thinking about it.  

But, as we tend to try and be QB45-compatible as much as possible, we can't really call this a bug.  It's just the way BASIC tends to do DATA -- even if that does get rather messy from time to time.  Wink
Reply


Messages In This Thread
Is this a bug? - by TerryRitchie - 05-12-2024, 12:38 AM
RE: Is this a bug? - by SMcNeill - 05-12-2024, 12:46 AM
RE: Is this a bug? - by TerryRitchie - 05-12-2024, 12:52 AM
RE: Is this a bug? - by SMcNeill - 05-12-2024, 01:26 AM
RE: Is this a bug? - by PhilOfPerth - 05-12-2024, 10:47 AM
RE: Is this a bug? - by grymmjack - 05-16-2024, 09:57 PM
RE: Is this a bug? - by SMcNeill - 05-16-2024, 10:51 PM



Users browsing this thread: 3 Guest(s)