Pete's QBASIC Site Forum Index Pete's QBASIC Site
Return to Pete''s QBasic Site
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

out of DATA

 
Post new topic   Reply to topic    Pete's QBASIC Site Forum Index -> QBASIC Questions & Answers
View previous topic :: View next topic  
Author Message
floogle11



Joined: 02 May 2009
Posts: 69
Location: Zorgon planet

PostPosted: Sat Jun 12, 2010 2:30 pm    Post subject: out of DATA Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
burger2227



Joined: 21 Aug 2006
Posts: 888
Location: Pittsburgh, PA

PostPosted: Sat Jun 12, 2010 4:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
floogle11



Joined: 02 May 2009
Posts: 69
Location: Zorgon planet

PostPosted: Sat Jun 12, 2010 9:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Pete's QBASIC Site Forum Index -> QBASIC Questions & Answers All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Protected by Anti-Spam ACP