Listen to QB64 Report!Our podcast on all things QB64 is out now. Listen athttp://podcast.qb64.org
0 Members and 1 Guest are viewing this topic.
Sounds interesting.I don't think LINE INPUT accepts a given input limit, but I made a restricted input routine function that you can freely have/use/abuse.- DavCode: QB64: [Select]'=========='KINPUT.BAS'=========='Restricted keyboard INPUT$ routine.'Limit how many characters you can enter.'Coded by Dav, JAN/2021 a$ = KINPUT$(3, 3, "Enter up to 12 letters: ", 12) PRINTPRINT "You entered: "; a$ FUNCTION KINPUT$ (y, x, text$, limitnum) LOCATE y, x: PRINT text$; entry$ = "" y = CSRLIN: x = POS(1) DO a$ = INPUT$(1) IF a$ = CHR$(13) THEN 'enter returns entry KINPUT$ = entry$: EXIT FUNCTION END IF IF a$ = CHR$(27) THEN 'ESC bails out KINPUT$ = "": EXIT FUNCTION END IF IF a$ = CHR$(8) THEN 'Backspace goes back a space IF LEN(entry$) > 0 THEN entry$ = MID$(entry$, 1, LEN(entry$) - 1) END IF ELSE 'add letter entered, if not over limitnum IF LEN(entry$) < limitnum THEN entry$ = entry$ + a$ END IF END IF LOCATE y, x: PRINT SPACE$(limitnum); LOCATE y, x: PRINT entry$; LOOP END FUNCTION
That IS Weird Paul! Love him so much. Nice work m8.