I'll post a question whenever I need help. Smile

First of all, how does getKey work in Prizm?
Apparently, it doesn't work like TI's getkey.
I read the manual, but I still haven't got any clue.
You put GetKey value in a variable, like this:

GetKey->K

Then the value of K will contain the key pressed. For example, the EXE key has a value of 31.
Oh. So I have to store getKey in variable?
Thanks.
yeongJIN_COOL wrote:
Oh. So I have to store getKey in variable?
Thanks.


Well, it's used exactly like with the 84+'s BASIC, so you can store it to a variable if you want to; either way, it can be used on it's own like a value holding the last key pressed.
one more question:
This code gives me syntax error.


Code:

Lbl B
GetKey→K
If K=27
Locate 3,3,"HI
IfEnd
Goto B


it gives me error at If K=27 part.
yeongJIN_COOL wrote:
one more question:
This code gives me syntax error.


Code:

Lbl B
GetKey→K
If K=27
Locate 3,3,"HI
IfEnd
Goto B


it gives me error at If K=27 part.


Use "Then".
oh. I have to use then?
Thanks
yeongJIN_COOL wrote:
oh. I have to use then?
Thanks


Yes, just like in TI-BASIC; however, you can't ever omit it, even for one line if blocks.
Apparently, this doesn't work:


Code:

...codes...
If A=6
Then
Goto Q
IfEnd
A=7[thick arrow]Goto T


the label exists, but it gives me GO error. Anyone knows why?
Ok. The program gives me the error right here. D:


Code:

...codes...
If A=6
Then
Goto Q //Gives me error here
IfEnd
Lbl Q

what did I do wrong?
Well I would guess becuase the If A=6 command never reaches its respectable IfEnd. Don't know for sure, becuase I only spent a little time with Prizm basic, it annoys me.
@zeldaking: it does reach A=6. Even if it didn't it shouldn't give me GO:ERROR thingy. Is there something wrong with my code?
Let's think here the GO:Error is obvoiusly an error with some goto command, right? I know it reaches A=6 I am saying it never reaches the IfEnd so it messes the execution up. Maybe?
Edit:
You are right it shouldn't give you an error. I tried it on my Calc and it works fine, did you get the OS update? Maybe that has something to do with it. I don't know you should ask a smarter person than me.
I'll post the entire code(it's quite short.)


Code:

Lbl S
ClrText
Red Locate 4,2,"ASCII
Blue Locate 13,2,"WORLD
Yellow Locate 1,1,"XXXXXXXXXXXXXXXXXXXXX
Yellow Locate 1,3,"XXXXXXXXXXXXXXXXXXXXX
Yellow Locate 1,7,"XXXXXXXXXXXXXXXXXXXXX
Locate 5,4,"NEW
Locate 5,5,"CONTINUE
Locate 5,6,"QUIT
0→K
4→A
While K!=78
Red Locate 3,A,">
0→K:While K=0
Getkey→K
WhileEnd
Locate 3,A,"
A+(K=37 And A!=6)-(K=28 and A!=4)→A
WhileEnd
If A=6
Then
Goto Q //Error here
IfEnd

Lbl Q
ClrText
I only see one WhileEnd... is that the problem?
zeldaking wrote:
I only see one WhileEnd... is that the problem?


I only see one While. So I think we're clear.

Yeong, you are able to eliminate the If:Then:Goto:End by doing this:


Code:
If A=6 => Goto Q


It saves bytes and won't cause memory leaks that will inevitably slow your program.
Quote:
Code:
If A=6 => Goto Q

You don't need If :

Code:
A=6 => Goto Q

To avoid bugs, you shouldn't use Goto/Lbl.

Code:

A=6 => Goto Q

I'm actually aware of this "optimization" since I was in 8th grade. Very Happy
However, for goto, both code didn't work. All I remember is that my code were supposed to work if it was fx-9750g. (excluding all the new commands, of course.)
If you use the Locate command with a string you should try placing a quotation mark at the end. If you do that your errors may just vanish.
Is there a way to do substring with PRIZM basic?
  
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 2
» 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