0 Members and 7 Guests are viewing this topic.
.INPUTNO"Input Number"→Str0ClrHomeDisp Str0sub(I)Disp A,iIf getKey(15)ClrHomeEndLbl I0→AgetKeyüKRepeat getKey(9)If K=36:7→{length(A)+A}If K=35:4→{length(A)+A}If K=34:1→{length(A)+A}If K=28:8→{length(A)+A}If K=27:5→{length(A)+A}If K=26:2→{length(A)+A}If K=20:9→{length(A)+A}If K=19:6→{length(A)+A}If K=18:3→{length(A)+A}EndGoto I
if I have an infinite loop in my application, is there a quit button like ON in Basic? and not having to take out the batteries?
.INPUTZeros(6)→N0→A"Input number:"→Str0Disp Str0,isub(I)If K=15ClrHomeReturnEndIf K=9Disp N>Dec,iEndLbl IgetKeyüKIf K=36:7→{N+A}EndIf K=36:7→{N+A}EndIf K=35:4→{N+A}EndIf K=34:1→{N+A}EndIf K=28:8→{N+A}EndIf K=27:5→{N+A}EndIf K=26:2→{N+A}EndIf K=20:9→{N+A}EndIf K=19:6→{N+A}EndIf K=18:3→{N+A}EndA++ReturnIf K=15ReturnIf length(N)=3ReturnIf K=9Disp N>Dec,iGoto I
Goto A would jump to Lbl A. Repeat getKey(15):End waits until the user presses clear.As for the code, A is always increased, not just when a key is pressed. What might work is checking if the byte is non-zero, after the byte is stored.Also I would change lines like this If K=36:7?{N+A}End to If K=36:7?{N+A}:End. There's more optimized ways to handle it, but the way you have it works enough.Btw numbers in axe/asm can only be up to two bytes. trying to make a three-byte number won't work.Axe is a lot less complicated than asm, but has some of the same concepts (pointers, data, etc)