Now, I've used data and read statements for quite some time. Now I'm getting a syntax error for my Read statement !
Here's my code:
FOR Y% = 1 TO NUMBER% 'number is the number of cubes
FOR X% = 1 TO 6 '6 sides of a cube
READ C% 'read some data
LET CUBES(Y, X) = C% 'store it to an array
NEXT X%
NEXT Y%
... blah
DATA 000, 000, 000, 000, 000, 000 'INTRO CUBE
DATA 000, 000, 000, 000, 000, 000
... more data
Have I forgotten something?
Read/Data error!
Read/Data error!
For any grievances posted above, I blame whoever is in charge . . .
The only way I know of adding remarks to the end of a DATA line is by putting a colon at the end of them, like this:
DATA 000, 000, 000, 000, 000, 000: 'INTRO CUBE
DATA 000, 000, 000, 000, 000, 000: 'ICE CUBE?
I didn't know about that trick until last year, and I don't think the QB manual even mentions it. It's in the QBKB here: http://kb.qbasicnews.com/Q36395.TXT
- Dav
DATA 000, 000, 000, 000, 000, 000: 'INTRO CUBE
DATA 000, 000, 000, 000, 000, 000: 'ICE CUBE?
I didn't know about that trick until last year, and I don't think the QB manual even mentions it. It's in the QBKB here: http://kb.qbasicnews.com/Q36395.TXT
- Dav
Good point, Dav! I forgot about that.Dav wrote:The only way I know of adding remarks to the end of a DATA line is by putting a colon at the end of them
And I usually always use colon before remarks to keep the spacing. I hate it when
x = 1 'First guy
becomes
x = 1'First guy
so I do
x = 1: ' First guy
I should have noted that this would apply to DATA also
Mac
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
People, please use code tags. It makes your post a lot easier to read, as some of you just randomly put code anywhere in your post, and sometimes it's hard to differentiate between the code and your post.
[/code]
Code: Select all
[code]This is a code tag!
So that's what those buttons are for .People, please use code tags
please goto:
http://www.petesqbsite.com/forum/viewtopic.php?t=2428
I didn't post there just for fun. I KNOW somebody has the answer.
For any grievances posted above, I blame whoever is in charge . . .