Page 1 of 1

out of DATA

Posted: Sat Jun 12, 2010 2:30 pm
by floogle11
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: Select all

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

Posted: Sat Jun 12, 2010 4:35 pm
by burger2227
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.

Posted: Sat Jun 12, 2010 9:17 pm
by floogle11
Thanks a lot