I'm making an RPG and for some reason my code is stopping early. I'm not sure why this is happening but I'm new to programming so perhaps someone here can help.

Here is the code for the combat phase that's glitching up.

Repeat Z
Repeat Z
getKey->Z
End
End
If Z=92
Then
Goto 1s
End
If Z=93
Then
Goto 2B
End
If Z=83
Then
Goto 5H
End
If F=1
Then
If Z=94
Goto 3F
End
If I=1
Then
If Z=82
Goto 4C
End

I've already run some experiments in a test program and it's definitely not a problem with the labels. What I'm guessing is for the last 10 lines, I need more "End"s to compensate for the 2 "If"s but I'd just like to make sure. Thanks! :)

You have two Repeat Z's. Why? That could be the problem. When it runs, is it giving you an error, ending the program early or just sitting there without responding to input?

EDIT: As a side note, you don't need Then and End for every single If statement. Then is only needed when you want more than one line of code to depend on the If's condition, and End is only necessary (for If statement cases, that is. It has multiple uses.) when you're using Then.

Yes, that ^ Also, I took the liberty of rewriting it a bit, if that is okay?

Repeat Z
getKey->Z
End
If Z=92
Goto 1S
If Z=93
Goto 2B
If Z=83
Goto 5H
If F=1 and Z=94 ;and is found in the TEST menu ([2nd][math][right])
Goto 3F
If I=1 and Z=82
Goto 4C

47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2

Agh it's still not working! I used your revised code Xeda and it's still stopping prematurely 0.0 I'm not doing anything wrong with getKey right? 1 goes to 1S, 2 goes to 2B, 3 Goes to 3F if F=1, 4 Goes to 4C if I=82, and 5 goes to 5H.

Here I'll give you one of the labels and maybe ya'll can tell me what's wrong. The stop happens no matter what I press so perhaps I'm doing something wrong with my labels:

After If G=1, remove the Then :) What happens is that if G is not 1, none of that code gets executed. I hope that helps!

47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2

47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2