J
Jon Kirwan
Guest
On Fri, 21 Dec 2012 20:33:10 -0800 (PST), Bill Bowden
<bperryb@bowdenshobbycircuits.info> wrote:
to set up a VM with a 32-bit Virtual XP and then copy all my
QBASIC stuff over from an older machine to try it out after
posting my response.
It was pretty easy to test. I didn't use just your code. I
used some I wrote, too, just to be absolutely sure.
No comments on DATA statements in QBASIC. The documentation
even mentions it: "A remark can be inserted on a line after
an executable statement if it is preceded by the single-quote
form of REM or if REM is preceded by a colon." Note the use
of "executable statement" in the above description. DATA is
not an executable statement.
Besides. I tried a lot of different ways to check this out.
You can't do it. Check it out yourself. It will actually read
up the comment, if you try using a string variable instead of
a numeric one. It is NOT a comment on a DATA statement. It is
part of the data, like it or not.
Jon
<bperryb@bowdenshobbycircuits.info> wrote:
Comments are the problem. I went through a bunch of troubleOn Dec 21, 7:42 pm, Jon Kirwan <j...@infinitefactors.org> wrote:
On Fri, 21 Dec 2012 17:55:42 -0800 (PST), Bill Bowden
bper...@bowdenshobbycircuits.info> wrote:
On Dec 20, 10:32 pm, Jon Kirwan <j...@infinitefactors.org> wrote:
On Thu, 20 Dec 2012 21:28:36 -0800 (PST), Bill Bowden
bper...@bowdenshobbycircuits.info> wrote:
Why does QBasic give me a syntax error with this code?
Comments aren't permitted on DATA statements, memory serving.
When I get a moment, I'll double check that detail, though.
Jon
I forget to mention the code works ok with Borland Turbo Basic. I did
find that adding an extra '2' to the data list fixes the problem so it
runs right in QBasic. I'm just wondering why I need an extra data
character in one case and not the other?
-Bill
Because QBASIC doesn't accept comments. Borland most
certainly does, by comparison.
Jon
I don't think the comments are the problem. In one case with Turbo
Basic the line reads "DATA
0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,2 '11100001011100"
In the second case with QBasic, the line reads "DATA
0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,2,2 '11100001011100 "
All I did was add an extra 2 which fixed the problem. But looking at
the code, the extra 2 at the end is not needed, but QBasic says it is.
to set up a VM with a 32-bit Virtual XP and then copy all my
QBASIC stuff over from an older machine to try it out after
posting my response.
It was pretty easy to test. I didn't use just your code. I
used some I wrote, too, just to be absolutely sure.
No comments on DATA statements in QBASIC. The documentation
even mentions it: "A remark can be inserted on a line after
an executable statement if it is preceded by the single-quote
form of REM or if REM is preceded by a colon." Note the use
of "executable statement" in the above description. DATA is
not an executable statement.
Besides. I tried a lot of different ways to check this out.
You can't do it. Check it out yourself. It will actually read
up the comment, if you try using a string variable instead of
a numeric one. It is NOT a comment on a DATA statement. It is
part of the data, like it or not.
Jon