Hi,
Yesterday I made an account on this forum because I had a problem... After some thinking I solved it myself... Now I've got a new problem and I hope someone can help me.
What I want to do is something like this:
1 A
Goto 2
Lbl 1
Locate 1,1,"This is label 1"
Lbl 2
Goto A
The problem is that you can also use 'A' as a label name. So you'd get an Go Error when you'd start this code.
Now what you could do is make a long piece a code which will check if the variable A is 1,2,3... or 9 and then go to that label, but it has to be easier... Does someone know how??
Eric
PS is there somewhere a switch statement in the program functions?
Goto Variable
Started by
ericlegomeer
, Aug 31 2008 10:37 AM
3 replies to this topic
#1
Posted 31 August 2008 - 10:37 AM
#2
Posted 01 September 2008 - 09:56 PM
Hello ericlegomeer and welcome to the forum!
According to your other thread, you have solved this problem, right? If so, you may want to post your solution here so others who are curious can learn also.
According to your other thread, you have solved this problem, right? If so, you may want to post your solution here so others who are curious can learn also.
#3
Posted 02 September 2008 - 05:40 AM
Well, the only answer I could come up with is something like this:
If A=1
Then Goto 1
Else If A=2
Then Goto 2
Else If A=3
Then Goto 3
But there has to be a better way...
Maybe I can store the number somewhere else, and then recall it ...
I'll keep trying, when I have finished it I'll post the answer, but for now on it's just a log piece a code...
Eric
If A=1
Then Goto 1
Else If A=2
Then Goto 2
Else If A=3
Then Goto 3
But there has to be a better way...
Maybe I can store the number somewhere else, and then recall it ...
I'll keep trying, when I have finished it I'll post the answer, but for now on it's just a log piece a code...
Eric
#4
Posted 08 September 2008 - 02:43 PM
Best way (in my opinion):
I don't know exactly what you want to do. But I like to avoid goto and lbls as much as possible because they confuse the heck outa me.
while 1 //main while a = 1 ... whileend while a = 2 ... whileend a = 1 whileend //to main
I don't know exactly what you want to do. But I like to avoid goto and lbls as much as possible because they confuse the heck outa me.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users