Here's some text and numeric input functions to help with more controlled way of inputting data. You can take out the:
SET TEXT FONT "Courier New"
SET TEXT SIZE 15
As i've only put that in due to me using a fixed width font when doing text input.
FUNCTION InputString(X AS INTEGER,Y AS INTEGER,InputLength AS INTEGER, Prompt$ AS STRING, PreviousString$ AS STRING)
` This routine will be the main input routine, the InputNum function will convert the number to a string and input with this function.
`
` X,Y Will be the coordinates on screen
` Prompt is a prompt on screen if Required
` Previous String if needed
`
` Setup Font and Characteristics
`
SET TEXT FONT "Courier New"
SET TEXT SIZE 15
SET TEXT OPAQUE
`
` Setup Temporary Veriables
`
PromptWidth=TEXT WIDTH(Prompt$)
InputX=X+PromptWidth+2
Res$=PreviousString$
CurrentPos=LEN(Res$)
IF InputLength""
PRINT PreviousString$;
ENDIF
PRINT "_";
`
` Main Input Loop
`
DO
IF RETURNKEY()
WHILE RETURNKEY()
ENDWHILE
SET CURSOR InputX,Y
PRINT Res$;" ";
EXIT
ENDIF
Key$=ENTRY$()
IF Res$"" AND ASC(Key$)=8
Res$=LEFT$(Res$,LEN(Res$)-1)
Key$=""
SET CURSOR InputX,Y
PRINT Res$;"_ ";
ENDIF
IF Key$"" AND LEN(Res$)31
IF ASC(Key$)>=48 AND ASC(Key$)