1,336 questions

817 answers

6,243 users

Welcome to ti 84 plus Questions and Answer. Feel free to ask any question related to ti 84 plus (or others texas instrument calculators or even HP or Casio calculators). You could also ask for help if you have sciences questions (math, physics ...) We provide help for ti-84-plus usage, programming, hardware, math...

here's more info...

0 votes
On the home screen, I can show "VAR P:" along with displaying the value of P which I store in A.  Then I call MYPROMPT:

PROGRAM:MYPROMPT
Lbl 1
getKey->K
If K=0
Goto 1
If K=105
Goto 9
Input "NEW? ",A
Lbl 9
Return

MYPROMPT will either leave A alone or update it.  Then, back in the main calling program I store A->P.

The problem is I waste a keypress getting to the Input line of code.  If I want the new value of A to be 123, I would like to enter 123, but end up pressing 1123 to get 123.  

(Part of the basic problem is that TI doesn't have a good way to represent numbers as strings, else I could go about this differently.)

As a newbie TI guy, perhaps there is a vastly easier way to do this.

Thanks for your time,

Craig
asked Jul 29, 2013 by anonymous

1 Answer

0 votes
Ok, the problem is that your getkey "eat" your first digit. It seems you want to let the user press "enter" if he don't want to modify the value. That's right, prompt/input don't let you do that. You can exit input without entering a value.

What you could do is to ask the user if he want to enter a value or not, so he answer the question and after you ask for A value.

e.g.

Disp "Cancel?"
Disp "0=Yes"
Disp "1=No"
0->K
While K=0
getKey->K
End

If K=92
Goto 1
Return
Lbl 1

Input "NEW?", A
etc...
 

Or you can inject the value stored in K (translate it using a tab).

I have done a piece of code which is not a good solution I think (but basically do the job with some limitations (complex, no error when bad format, etc...) :

 

ClrHome
Disp "NEW?"
0->K
12->Dim(L1
{102,92,93,94,82,83,84,72,73,74,103,104}->L1  (Translate keycodes to integers with index)
1->X
8->Y
0->R
1->N
0->F
While K!=105 (replace != by what you have in Math menu)
getKey->K
For(I,1,12
If K=L1(I
Then
If I=12:Then
-1->N (dummy, handle negative, need to test if - is first char, not done yet)
Output(Y,X,"-
Else
If I=11:Then
1->F
Output(Y,X,"."
Else
R*10->R
(I-1)+R->R
Output(Y,X,(I-1)
F*10->F (if . is not pressed, F = 0, so F is disabled, F is floating part)
End
End
X+1->X
If X>16:Then
1->X
Y+1->Y
If Y>8:Then
ClrHome  (dummy, could do something else)
1->Y:Disp ""
End
End
End
End
End
If F!=0
R*(1/F)->R
R*N->R
ClrHome
Disp R

Yes this is bad, I don't do any basic for a long period, maybe someone else could give a real good solution :D
 

And maybe there's a very simple solution for this issue, but personnaly I don't know !
answered Jul 30, 2013 by anonymous

Related questions

0 votes
0 answers 304 views
asked Feb 8, 2014 by anonymous
0 votes
0 answers 228 views
0 votes
1 answer 5,733 views
...