プレイ日記
King 5kittens645
So I've run into a problem: I have a GOSUB send me to the Label listed here, but after that a GOTO sends it to another label. I want to make it return to where it started, but i can't figure out how because of this.
0そうだね
プレイ済み
返信[1]
親投稿
Bobert fluffy8959
RETURN
0そうだね
プレイ済み
返信[2]
親投稿
Bobert fluffy8959
Actually, that’s not what you want, try to be more descriptive. You are probably trying to use some sort of loop but I’m not sure.
0そうだね
プレイ済み
返信[3]
親投稿
King 5kittens645
I used RETURN, but because of the way i structured the code, it sends me back to the last label. I honestly don't think there is a way to fix this.
0そうだね
プレイ済み
返信[4]
親投稿
King 5kittens645
I think what i need is an area of code dedicated to sending you back to a certain label depending upon whether or not a variable is equal to 1.
0そうだね
プレイ済み
返信[5]
親投稿
Bobert fluffy8959
There is always a way… I’m just not sure what you are trying to do, when you say “another label,” it would be helpful to know which label or line you are talking about.
0そうだね
プレイ済み
返信[6]
親投稿
Bobert fluffy8959
IF VARIABLE==1 THEN GOTO @LABEL1 ELSE GOTO @LABEL2 Or ON VARIABLE GOTO @LABEL1,@LABEL2
0そうだね
プレイ済み
返信[7]
親投稿
King 5kittens645
I think I'll just have something similar to the first example in the code. This is gonna give me a headache...
0そうだね
プレイ済み
返信[8]
親投稿
Bobert fluffy8959
Well, here are two problems I’ve noticed in the code shown. No matter what COLOR1 and TRED equals, the program will always go to label REDRULES, and label REDRULES is an infinite loop. I’d suggest learning and understanding the language well before trying to make a program too complicated.
0そうだね
プレイ済み
返信[9]
親投稿
King 5kittens645
That is the exact problem i am having. And I'm not trying to make this complicated, it just came out that way. I don't need to learn this language well anyway because I'm probably going to stop using it soon.
0そうだね
プレイ済み
返信[10]
親投稿
Bobert fluffy8959
Saying that you don’t need to learn BASIC tells me that you’re problem isn’t important to you. You’re sending the wrong impression… BASIC is one of the easiest programming languages, learn it, it is useful.
0そうだね
プレイ済み