LineNames in SUB

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Guest

LineNames in SUB

Post by Guest »

e.g.:

Code: Select all

SUB Intro
PRINT "This is the intro sub."

ChangeColor:

Color  2
PRINT "Colour changed"

Color 15
PRINT "OK."

GOTO ChangeColor
END SUB
If I use somthing like this, the program says it can't find 'ChangeColor:'. Is there a way to get around this?

grtz
SebMcClouth
User avatar
Kyle
Veteran
Posts: 107
Joined: Thu Apr 14, 2005 2:41 pm

Post by Kyle »

Use line numbers? See if they work.
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Dont use GOTO

Use DO, LOOP instead.
I have left this dump.
User avatar
mundofr
Coder
Posts: 34
Joined: Sat Apr 16, 2005 9:11 pm
Location: IN, USA
Contact:

Post by mundofr »

well if that is the whole program u should use a loop but i doubt it, so then try to use line numbers as sum1 said. if that doesnt work then i dont kno wats wront with it :D
<b><i> "Rock is the first thing in life, after rock comes the comp...." Rock on Big M</i></b>
<img src="http://www.freewebs.com/mundofr/bigm2.bmp">
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

The
GOTO ChangeColor
seemed to work for me. I don't know why it wouldn't work for you. You can use GOSUB also.
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

It doesent work in FB

It works in QB45 and QB71
I have left this dump.
Post Reply