| View previous topic :: View next topic |
| Author |
Message |
floogle11

Joined: 02 May 2009 Posts: 69 Location: Zorgon planet
|
Posted: Sat Jun 12, 2010 2:30 pm Post subject: out of DATA |
|
|
Ive been doing more with graphics and a lot of times when i use the DATA command after when i run it it says :
"Line 17:
out of DATA"
what does that mean?
Heres my code:
| Code: | CLS
SCREEN 13
x = 100
y = 100
a = 0
b = 0
FOR a = 0 TO 1
FOR b = 0 TO 1
data 00,01,
data 01,00,
data 00,01,
READ z
PSET (x, y), z
NEXT b
NEXT a |
_________________ Go to my Qbsite its: Trueqb.webs.com
Or if you play nazi zombies go to www.Nazizombys.com and register for cheats, hints, and strategys. |
|
| Back to top |
|
 |
burger2227

Joined: 21 Aug 2006 Posts: 888 Location: Pittsburgh, PA
|
Posted: Sat Jun 12, 2010 4:35 pm Post subject: |
|
|
Where is the DATA? When using nested FOR loops, you will need DATA for both loops. Simply multiply the numbers of the loops to determine how many. Your code indicates 4 READs.
I advise labeling DATA fields if DATA is used more than once. Just make a line label before the DATA and use the label with RESTORE before reading it.
RESTORE MyData
READ x, y
MyData:
DATA
DATA
DATA
I recommend placing all labeled DATA fields after the main program code.
You cannot place DATA into SUB procedures. _________________ Please acknowledge that you have read an answer!
QB64 is a FREE QBasic compiler for 32/64 bit WIN and LINUX PC's! : http://www.qb64.net/forum/
Get my Q-Basics demonstrator here (fast download): http://dl.dropbox.com/u/8440706/Q-Basics.zip |
|
| Back to top |
|
 |
floogle11

Joined: 02 May 2009 Posts: 69 Location: Zorgon planet
|
Posted: Sat Jun 12, 2010 9:17 pm Post subject: |
|
|
Thanks a lot _________________ Go to my Qbsite its: Trueqb.webs.com
Or if you play nazi zombies go to www.Nazizombys.com and register for cheats, hints, and strategys. |
|
| Back to top |
|
 |
|