| Author |
Message |
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 12 Feb 2012 02:32:35 pm Post subject: Prizm BASIC question |
|
|
I'll post a question whenever I need help.
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. |
|
| Back to top |
|
|
gbl08ma
Power User

Joined: 26 Nov 2011 Posts: 476 Location: Portugal
|
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 12 Feb 2012 02:38:35 pm Post subject: |
|
|
Oh. So I have to store getKey in variable?
Thanks. |
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2418 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 12 Feb 2012 02:50:19 pm Post subject: |
|
|
| 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. _________________ -Ashbad |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 12 Feb 2012 07:05:05 pm Post subject: |
|
|
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. |
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2418 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 12 Feb 2012 07:14:37 pm Post subject: |
|
|
| 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". _________________ -Ashbad |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 12 Feb 2012 07:15:08 pm Post subject: |
|
|
oh. I have to use then?
Thanks |
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2418 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 12 Feb 2012 07:16:10 pm Post subject: |
|
|
| 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. _________________ -Ashbad |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 15 Feb 2012 07:39:13 pm Post subject: |
|
|
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? |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 15 Feb 2012 08:17:16 pm Post subject: |
|
|
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? |
|
| Back to top |
|
|
zeldaking
Power User

Joined: 31 Jul 2011 Posts: 470 Location: Utah
|
Posted: 15 Feb 2012 08:22:12 pm Post subject: |
|
|
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.
Last edited by zeldaking on 15 Feb 2012 08:23:33 pm; edited 1 time in total |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 15 Feb 2012 08:23:25 pm Post subject: |
|
|
| @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? |
|
| Back to top |
|
|
zeldaking
Power User

Joined: 31 Jul 2011 Posts: 470 Location: Utah
|
Posted: 15 Feb 2012 08:25:24 pm Post subject: |
|
|
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. |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 15 Feb 2012 08:42:25 pm Post subject: |
|
|
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
|
|
| Back to top |
|
|
zeldaking
Power User

Joined: 31 Jul 2011 Posts: 470 Location: Utah
|
Posted: 16 Feb 2012 01:01:28 am Post subject: |
|
|
| I only see one WhileEnd... is that the problem? |
|
| Back to top |
|
|
comicIDIOT

Guru

Joined: 01 May 2006 Posts: 5108 Location: SFBA, California
|
|
| Back to top |
|
|
Purobaz

Advanced Newbie

Joined: 26 Nov 2011 Posts: 67 Location: France
|
Posted: 16 Feb 2012 03:15:18 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
|
| Back to top |
|
|
m1ac4

Advanced Newbie

Joined: 16 Sep 2010 Posts: 43
|
Posted: 16 Feb 2012 07:31:17 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
|
yeongJIN_COOL
Member

Joined: 28 Apr 2011 Posts: 161
|
Posted: 24 Feb 2012 07:07:40 pm Post subject: |
|
|
| Is there a way to do substring with PRIZM basic? |
|
| Back to top |
|
|
|