Have a Question?
Print

00031: Sample programs to load function keys for INPUT, INPUTE, INPUTN verbs

Title:

Sample programs to load function keys for INPUT, INPUTE, INPUTN verbs

Description:

This program loads F1-F10 with CTL values 1-10, respectively, for INPUTE. It also loads the left arrow key with $40$, the editor function to move left one character; the right arrow key with $41$, the editor function to move right one character; the up arrow key with $4D$, the editor function to move to the end of the line of input; and the down arrow key with $4C$, the editor function to move to the beginning of the line of input. 

0010 REM “loads function keys 1-10 with ctl values 1-10, for inpute 
0020 REM “also loads arrow keys for inpute: 
0030 REM “<– moves left one character 
0040 REM “–> moves right one character 
0050 REM “^ up arrow moves to the end of the line of input 
0060 REM “v down arrow moves to the beginning of the line of input 
0070 PRINT ‘FL’+”3″+ 
0070:$0A000181010182020183030184040185050186060187070188080189090190$, 
0080 PRINT ‘EL’+”3″+$04000191010192020193030194$, 
0090 LET 
0090:A$=$810182028303840485058606870788088909900A91409241934D944C$+ 
0090:STBL(“!EDIT”) 
0100 LET B$=STBL(“!EDIT”,A$) 
0110 INPUTE 5,5,30,”_”,X$; PRINT CTL; GOTO 0110 
0120 END 

This program loads F1-F10 with CTL values 1-10, respectively, for INPUTN and INPUTE. It also loads the left arrow key with $40$, the editor function to move left one character; and the right arrow key with $41$, the editor function to move right one character. The up and down arrow keys are loaded with CTL values 1 and 2, respectively. The program also demonstrates the use of these CTL values in the up and down arrows for program flow control. 

0010 REM “loads function keys 1-10 with ctl values 1-10, for input, inpute and 
0010: inputn 
0020 REM “also loads arrow keys for inputn and inpute 
0030 REM “<– moves left one character (inpute, inputn only, has ctl=64 for 0030:input) 
0040 REM “–> moves right one character (inpute, inputn only, has ctl=65 for 0040:input) 
0050 REM “^ up arrow has ctl value = 1 
0060 REM “v down arrow has ctl value = 2 
0065 REM “!EDIT is for INPUTE and INPUTN; !TERMS is for INPUT 
0070 PRINT ‘CS’ 
0080 PRINT ‘FL’+”3″+ 
0080:$0A000181010182020183030184040185050186060187070188080189090190$, 
0090 PRINT ‘EL’+”3″+$02000191010192$, 
0100 LETA$= 
0100:$810182028303840485058606870788088909900A914092411E011F02$ 
0110 LET B$=STBL(“!EDIT”,A$+STBL(“!EDIT”)) 
0112 LET C$=STBL(“!TERMS”, A$+STBL(“!TERMS”)) 
0115 PRINT “ctl=0 to return; 1 to backup; >=2 to go forward” 
0120 FIRST: 
0130 INPUTE 4,4,30,”_”,VAL$;PRINT CTL 
0140 ON CTL GOTO FIRST,FOURTH,SECOND 
0150 SECOND: 
0160 INPUTN 5,5,”##.00″,”##.00″,FLAG$,X1,X; PRINT CTL 
0170 ON CTL GOTO SECOND,FIRST,THIRD 
0180 THIRD: 
0190 INPUTN 6,6,”##.00″,”##.00″,FLAG$,X1,X; PRINT CTL 
0200 ON CTL GOTO THIRD,SECOND,FOURTH 
0210 FOURTH: 
0220 INPUTN 7,7,”##.00″,”##.00″,FLAG$,X1,X; PRINT CTL 
0230 ON CTL GOTO FOURTH,THIRD,FIRST 
0240 FIFTH: 
0250 END 

This program loads F1-F9 with CTL values 1-9, respectively, for INPUT and INPUTE. It also loads the left arrow with CTL=11, the right arrow with CTL=10, the up arrow with CTL=9, and the down arrow with CTL=12. 

0005 PRINT ‘CS’ 
0010 REM Load F1-F9 with CTL values 1-9 for input and inpute 
0015 REM Load arrows <- with ctl 11, -> with ctl 10, ^ with ctl 9, v with ctl 12 
0020 PRINT ‘FL’+”3″+ 
0020:$09000181010182020183030184040185050186060187070188080189$ 
0025 PRINT ‘EL’+”3″+$0400018A01018B02018C03018D$, 
0030 LET A$=$8101820283038404850586068707880889098A0B8B0A8C098D0C$ 
0040 LET B$=A$+STBL(“!EDIT”) 
0050 LET C$=STBL(“!EDIT”,B$) 
0060 LET D$=A$+STBL(“!TERMS”) 
0070 LET E$=STBL(“!TERMS”,D$) 
0080 INPUTE 10,10,10,”_”,VAL$; PRINT CTL,”inpute ctl” 
0090 INPUT X$; PRINT CTL,”input ctl”; GOTO 0080 
0100 END 

This program loads F1-F12 with CTL values 1-12, respectively, for INPUT, INPUTE and INPUTN: 

0005 PRINT ‘CS’ 
0010 REM Load F1-F12 with ctl values 1-12 for input and inpute 
0020 PRINT ‘FL’+”3″+ 
0020:$0C000181010182020183030184040185050186060187 
0020:07018808018909018A0A018B0B018C$, 
0030 LET A$=$8101820283038404850586068707880889098A0A8B0B8C0C$ 
0040 LET B$=A$+STBL(“!EDIT”) 
0050 LET C$=STBL(“!EDIT”,B$) 
0060 LET D$=A$+STBL(“!TERMS”) 
0070 LET E$=STBL(“!TERMS”,D$) 
0080 INPUTE 10,10,10,”_”,VAL$; PRINT CTL,”inpute ctl” 
0090 INPUT X$; PRINT CTL,”input ctl”; GOTO 0080 
0100 END 

This program loads F1-F16 with CTL values 1-16, respectively, for INPUT, INPUTE and INPUTN. The program expects a 16 function key keyboard, and all function keys must be defined in termcap, if on a Unix system. 

0010 REM “load function keys 1-16 with ctl values 1-16, for input, inpute and 
0010:inputn 
0020 REM “in termcap, k1=F1,k2=F2,…k0=F10,kA=F11,kB=F12,… 
0030 PRINT ‘FL’+”3″+ 
0030:$10000181010182020183030184040185050186060187070188 
0030:0801890901900A01910B01920C01930D01940E01950F0196$, 
0040 LET A$= 
0040:$810182028303840485058606870788088909900A910B920C930D940E 
0040:950F9610$ 
0050 LET B$=STBL(“!TERMS”,A$+STBL(“!TERMS)) 
0055 LET C$=STBL(“!EDIT”, A$+STBL(“!EDIT”)) 
0060 INPUT “Value : “,A$; PRINT “Value : “,A$,” CTL : “,CTL; GOTO 0060 
0070 END 

This program loads F1-F12 with CTL values 1-12, respectively, for use with the INPUT 
verb. It also loads shift+F1 with CTL=13, shift+F2 with CTL=14, etc., up to shift+F10 
(CTL=22) for INPUT. All of these function keys must be defined in the TERMCAP file, 
if on a Unix system. The program expects a 12 function key keyboard. DOS users 
need the ‘ekb’ or “expanded keyboard” capability enabled. 

0010 REM “loads function keys 1-12 with ctl values 1-12, for input 
0020 REM “loads shift F1 w/ ctl 13, shift F2 w/ ctl 14,….shift F10 w/ ctl 22, for 
0020:input 
0030 REM “in termcap, k1=F1, k0=F10, kA=F11, kB=F12, kC=shift F1, 
0030:kD=shift F2,…kL=shift F10 
0040 PRINT ‘FL’+”3″+ 
0040:$160001810101820201830301840401850501860601870701880801890901900 
0040:A01910B01920C01930D01940E01950F019610019711019812019913019A140 
0040:19B15019C$, 
0050 LET A$= 
0050:$810182028303840485058606870788088909900A910B920C930D940E950F9610 
0050:9711981299139A149B159C16$+STBL(“!TERMS”) 
0060 LET B$=STBL(“!TERMS”,A$) 
0070 INPUT “Value : “,A$; PRINT “Value : “,A$,” CTL : “,CTL; GOTO 0070 
0080 END 



Last Modified: 12/18/1997 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top