The Editors and Readers of COMPUTE!
ACCEPT On TI
I have a problem using ACCEPT on my TI-99/4A with Extended BASIC. When I try to enter numeric input with ACCEPT and accidentally press ENTER before any input, the screen scrolls and I get an error message. Is there any way I can avoid this without using the CALL KEY statement?
Jory Rannow
The following program illustrates one solution to your problem:
100 CALL CLEAR
110 DISPLAY AT(1,1):"ROW
#1"
120 ACCEPT AT(2,1)VALIDAT
E(NUMERIC):X$
130 IF X$="" THEN 120
140 X=VAL(X$)
150 PRINT X
After this program clears the screen, line 110 prints a message on line 1 so you can tell whether scrolling occurs. Line 120 takes in numeric input (numerals 0-9, period symbol, plus symbol, minus symbol, or E) and accepts the input as X$. If at this point you hit ENTER by mistake, line 130 sends you back for another try without scrolling the screen. Once you've entered a value, line 140 converts it from a string into the numeric variable X.