Hey! I am writing a Casio-Basic program but it will not work, what am I doing wrong?
My code:
Lbl 1
B=0
Isz B:
B◄
ClrText
Goto 1
If B=100
Then
ClrText
Menu "Upgrade 1","Small upgrade (+5)",D,
"Tiny Upgrade (+2),E,"I'm good, I'll wait.",F
Lbl D
"you clicked; Small upgrade"
Lbl E
"you clicked; Tiny Upgrade"
Lbl F
"you clicked; I'm good, I'll wait."

The statement about b=100 does not work and whenever B gets to 100 it just skips the If statement and goes straight to 101, please help.
This initial part of your program :

Code:
Lbl 1
B=0
Isz B:
B◄
ClrText
Goto 1

is an infinite loop, you never jump around that Goto 1 so your program continuously loops back there.

You should have the menu inside the main loop, and preferably use While rather than Goto/Lbl.

Finally, your menu as it is will not work since clicking on the small upgrade will jump to Lbl D then proceed to run the code below in labels E and F. Each of these labels should end with a jump to after the last line, which would loop back to the start of the program.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement