Enjoy the board
You are not logged in.
Basic as in simple. I'm trying to create an IF statement and having a lot of trouble. I want it to be IF 1<B<5, but it won't let me have the two signs. Also, how can I have it so only integers are allowed to be entered into prompts and inputs?
1. IF 1<B AND B<5
2. Depends on the calculator. On the 85, you can't force it to accept only integers (you either tell it to accept numbers or strings; for the former, it'll evaluate it as an expression and 'crash' if you give it a bad input), though the later calculators probably allow you to be more strict.
Also, how can I have it so only integers are allowed to be entered into prompts and inputs?
Repeat X=int(X Prompt X End
This will keep on doing prompt until X is integer. You can add stuff like a message to tell you to only add integers if a non integer value is inputted, or ClrHome to clear the screen every time it asks again (so your screen doesnt get flooded with 'X?')
On the older calculators (85, 86), you can't reference undefined variables, so you need to resort to something like this:
Prompt X While X≠int(X Prompt X End
In that case, 0.1->X would work a bit better, but the overall effect is the same (though it'd take a few more bytes of code).
I have an 83+ and I'm just finding something to do during math class. I'll definitely try these after I'm tired of my PSP.