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 !