Have a Question?
Print

00025: General overview for ‘FL’, ‘EL’, !EDIT, !TERMS, STBL

Title:

General overview for ‘FL’, ‘EL’, !EDIT, !TERMS, STBL

Description:

How do you program function keys and edit keys to terminate input verbs with certain CTL values? 

The first step is to load the function keys and/or edit keys with unique values. 

The second step is to modify the global string !TERMS (for the INPUT verb), or !EDIT (for the INPUTE or INPUTN verbs). These strings are modified to associate the unique values loaded into the function or edit keys with terminators and the corresponding CTL values you want returned. 

STEP 1 for Function Keys: 

The Function Key Load mnemonic, ‘FL’, can be used to set the value returned by a function key. For example, the statement below will load the hexadecimal value $81$ into function key number 1: 

>0010 PRINT ‘FL’,”2″,$000181$, 

Where: “2” Invokes the ‘FL’ mnemonic’s function to load only one key. (To load multiple keys in one step, see the example under STEP 1 for Edit Keys.) 

$00$ Is the hexadecimal key number for function key number 1. 

$01$ Is the byte length of the value to be soft loaded into the key. 

$81$ Is a hexadecimal value to be soft loaded. Any value can be loaded, as long as it is unique. High Order ASCII values can be a good source for these values. However, check the ASCII character set for values already in use by your environment, especially if you are running BBx under the Windows operating system. 

A series of CHR(decimal integer 0..255) functions can be used in place of the hexadecimal representation of the key number, byte length, and value to be loaded. For example, the following statement is exactly equivalent to the PRINT statement above. 

>0010 PRINT ‘FL’,”2″,CHR(0),CHR(1),CHR(129), 

You could just as easily load several function keys in one step. Step 1 for Edit Keys illustrates this style of syntax for loading multiple keys. Just substitute the Function Key Load mnemonic, ‘FL’, for the Edit Key Load mnemonic in the examples. 

STEP 2 for Function Keys: 

If your software uses the standard INPUT verb, the STBL() function can be used to modify the !TERMS global string so that a particular function or edit key terminates an INPUT statement with a pre-programmed CTL value. 

For example, if you used the ‘FL’ example in Step 1 above, and you would like function key number 1 to terminate an INPUT statement (act as a return) with a CTL value of 1, then you will need to add the byte pairs $8101$ to the !TERMS global string. This maps the value you loaded into function key number 1, $81$, to set the CTL to 1 (hexadecimal $01$ = decimal 1):

>0020 LET PAIR$=$8101$; REM “Pair order IS important 
>0030 LET ADD_THIS$=STBL(“!TERMS”,PAIR$+STBL(“!TERMS”)) 
or 
>0020 LET PAIR$=CHR(129)+CHR(1) 
>0030 LET ADD_THIS$=STBL(“!TERMS”,PAIR$+STBL(“!TERMS”)) 

If your software uses INPUTE or INPUTN statements, the STBL function would be used to modify the !EDIT global string instead of the !TERMS global. For example: 

>0040 LET PAIR$=$8101$ 
>0050 LET ADD_THIS$=STBL(“!EDIT”,PAIR$+STBL(“!EDIT”)) 
or 
>0040 LET PAIR$=CHR(129)+CHR(1);REM “Pair Order is STILL important 
>0050 LET ADD_THIS$=STBL(“!EDIT”,PAIR$+STBL(“!EDIT”)) 

Either of the two previous examples (lines 40 and 50) maps the value you loaded into function key number 1, $81$, to set the CTL to 1. Then, if the user presses the <F1> function key during an INPUTE or INPUTN statement, the function key will act as a return to terminate these input statements and set CTL to 1. 

STEP 1 for Edit Keys: 

The Edit Key Load mnemonic, ‘EL’, can be used to set the value returned by an edit key. For example, the statement below will load the hexadecimal value $81$ into the Up Arrow key, and the value $82$ into the Down Arrow key: 

>0060 PRINT ‘EL’,”3″, $02020181030182$, 
or 
PRINT ‘EL’,”3″,CHR(2),CHR(2),CHR(1),CHR(129),CHR(3),CHR(1),CHR(130), 

Where: “3” Invokes the ‘EL’ mnemonic to load more than one key. 

$02$ Is the number of keys to load. 

$02$ Is the edit key number in hexadecimal for the Up Arrow key. 

$01$ Is the byte length of the value to be soft loaded into the Up Arrow key. 

$81$ Is the unique hexadecimal value to be soft loaded into the Up Arrow key. 

$03$ Is the edit key number in hexadecimal for the Down Arrow key. 

$01$ Is the byte length of the value to be soft loaded into the Down Arrow key. 

$82$ Is the unique hexadecimal value to be soft loaded into the Down Arrow key. 

STEP 2 for Edit Keys: 

If you used the ‘EL’ example in Step 1 above, and you would like the Up Arrow key and the Down Arrow key to terminate an INPUT statement with CTL values of 1 and 2, respectively; then you will need to add the byte pairs $8101$ and $8202$ to the !TERMS global string. This maps the value you loaded into the Up Arrow key, $81$, to set the CTL to 1 (hexadecimal $01$ = decimal 1), and it maps the value you loaded into the Down Arrow key, $82$, to set the CTL to 2 (hexadecimal $02$ = decimal 2): 

>0070 LET PAIR$=$81018202$ 
>0080 LET ADD_THIS$=STBL(“!TERMS”,PAIR$+STBL(“!TERMS”)) 
or 
>0070 LET PAIR$=CHR(129)+CHR(1)+CHR(130)+CHR(2) 
>0080 LET ADD_THIS$=STBL(“!TERMS”,PAIR$+STBL(“!TERMS”)) 

When the Up Arrow key and the Down Arrow key are soft loaded with $81$ and $82$, and you wish INPUTE or INPUTN statements to terminate with CTL values of 1 and 2, respectively; then use the STBL() function to add the byte pairs $8101$ and $8202$ to the !EDIT global string: 

>0090 LET PAIR$=$81018202$ 
>0100 LET ADD_THIS$=STBL(“!EDIT”,PAIR$+STBL(“!EDIT”)) 
or 
>0090 LET PAIR$=CHR(129)+CHR(1)+CHR(130)+CHR(2) 
>0100 LET ADD_THIS$=STBL(“!EDIT”,PAIR$+STBL(“!EDIT”)) 

The Up Arrow and Down Arrow keys will now terminate (act as a return) on an INPUTE or an INPUTN verb with the assigned CTL value set. 



Last Modified: 01/04/2005 Product: PRO/5 Operating System: All platforms

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

Table of Contents
Scroll to Top