If I'm understanding the problem correctly, this should achieve the desired effect.
and if you need the escape and spacebar options...
Code: (Select All)
PRINT "Enter a digit"
K$ = "": F$ = ""
DO
F$ = INKEY$
IF F$ <> "" THEN
IF F$ = CHR$(13) THEN
F$ = "7"
ELSE
IF INSTR("0123456", F$) THEN F$ = MID$("0123456", INSTR("0123456", F$), 1) ELSE F$ = ""
END IF
K$ = K$ + F$
END IF
_LIMIT 30
LOOP UNTIL LEN(F$) <> 0
T# = VAL(K$): PRINT T#
and if you need the escape and spacebar options...
Code: (Select All)
PRINT "Enter a digit"
K$ = "": F$ = ""
DO
F$ = INKEY$
IF F$ <> "" THEN
IF F$ = CHR$(13) THEN
F$ = "7"
ELSEIF F$ = CHR$(27) THEN
GOTO escape
ELSEIF F$ = CHR$(32) THEN
GOTO spacebar
ELSE
IF INSTR("0123456", F$) THEN F$ = MID$("0123456", INSTR("0123456", F$), 1) ELSE F$ = ""
END IF
K$ = K$ + F$
END IF
_LIMIT 30
LOOP UNTIL LEN(F$) <> 0
T# = VAL(K$): PRINT T#
END
escape:
'do whatever escape is supposed to do
spacebar:
'do whatever the spacebar is supposed to do
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: