11. String input function ~~~~~~~~~~~~~~~~~~~~~ This Function is an alternative to using a conventional INPUT statement for strings. You specify the minimum and maximum number of characters in the string, and the Function does the rest. The example given is for 2 and 6 characters respectively, whereas an INPUT statement is effectively for 0 and 255. You will find that you cannot press until you have typed in the minimum number of characters, and that you cannot type more than the maximum. Full use of the and keys is allowed. This Function is quite tricky to type in without errors, so take care. I've only put spaces in for clarity, and you can omit them all except immediately before the word "ELSE". If you want the cursor to remain on the same line after is pressed on a valid string, then omit the final PRINT: in line 140, so that you have just ELSE =I$. 10 PRINT"Enter Name ";:name$=FNinp(2,6):GOTO 10 100 DEFFNinp(min%,max%):LOCALG%,G$,I$:*FX21,0 110 PRINT G$; 120 G$=GET$:G%=ASC(G$) 130 IF(LEN(I$)=max% AND G%<>13 AND G%<>127)OR(((LEN(I$)=0 AND(G%<33 OR G%>126))OR(LEN(I$)0 OR G%<>13))THEN VDU7:GOTO 120 140 IF G%>31 AND G%<127 THEN I$=I$+G$:GOTO 110 ELSE IF G%=127 THEN I$=LEFT$(I$,LEN(I$)-1):GOTO 110 ELSE IF G%<>13 THEN VDU7:GOTO 120 ELSE PRINT:=I$