STBL Formats

For BBj-Specific information, see STBL Formats - BBj.

The STBL() function may be used to load several configuration tables used by PRO/5. The following is a description of each table recognized.

STBL("!EDIT")

The !EDIT string is used to map input characters to edit functions. This string is used by PRO/5 for the EDIT window, the INPUTE verb, and the INPUTN verb. The string must be an even number of bytes long and consist of byte pairs. The first byte of each pair contains a keystroke value that would be typed by the user. The second byte indicates which editor function is invoked by that keystroke. The function values are as follows:

Function Name

Value

Default Key(s)

Default String

Exit

0..62

CR ($0D$)

$0D00$

Help

63 ($3F$)

^Y ($19$)

$193F$

Left

64 ($40$)

LEFT, F2 ($1D$)

$1D40$

Right

65 ($41$)

RIGHT, F1 ($1C$)
^L ($0C$)

$1C41$
$0C41$

Up

66 ($42$)

UP, F3 ($1E$)
^K ($0B$)

$1E42$
$0B42$

Down

67 ($43$)

DOWN, F4 ($1F$)
^J ($0A$)

$1F43$
$0A43$

Backspace

68 ($44$)

BACKSPACE, ^H ($08$)

$0844$

Restore value

69 ($45$)

^R ($12$)
ESC ($1B$)

$1245$
$1B45$

Toggle insert

70 ($46$)

^T ($14$)

$1446$

Insert char

71 ($47)

^E ($05$)

$0547$

Delete char

72 ($48$)

^X ($18$)

$1848$

Tab

73 ($49$)

TAB, ^I ($09$)

$0949$

Back tab

74 ($4A$)

^B ($02$)

$024A$)

Clear

75 ($4B$)

^W ($17$)

$174B$

Beginning line

76 ($4C$)

^A ($01$)

$014C$

End

77 ($4D$)

^Z ($1A$)

$1A4D$

Insert line

78 ($4E$)

^O ($0F$)

$0F4E$

Delete line

79 ($4F$)

^D ($04$)

$044F$

Page down

80 ($50$)

 

 

Page up

81 ($51$)

 

 

Reprint

82 ($52$)

 

 

Next word

83 ($53$)

 

 

Prev word

84 ($54$)

 

 

Popup Calendar (BBj)

85 ($55$)

^P ($10$)

$1055$

PRINT HTA(STBL("!EDIT"))

0D00 0844 1D40 0C41 1C41 0B42 1E42 0A43 1F43 1245 1B45 1446 014C 1A4D 0949 024A 174B 1848 0547 044F 0F4E 193F

Any value less than 63 will cause the input function to exit setting the CTL value to the function value. The "help" function causes an exit with CTL=-1.

When insert mode is toggled with CTL-T, SETOPTS byte 1 bit $20$ is also toggled.

STBL("!DATE")

The !DATE string contains the default date format as well as the text for month and day names each separated by a $00$ character. The default date format comes first and is used by the DATE() function if no format is specified. Next come abbreviated month names, followed in order by long month names, abbreviated day names, and long day names.

Following is a template that may be used for accessing the !DATE string. It defines the default date format followed by 12 short month names (sm), 12 regular month names (m), 7 short day names (sd), and 7 normal day names (d).

DIM DATE$:"default:c(32*=0),sm[12]:c(3*=0),m[12]:c(32*=0),sd[7]:c(3*=0),d[7]:c(32*=0)"

For example the short name for January is usually Jan. The month and day names returned by the DATE() function may easily be changed for international users.

STBL("!CTYPE")

The !CTYPE string is used by PRO/5 to determine character types and lower/upper case conversions. Specifically, this string is used for character type checking during string masking (and INPUTE), and by the CVS() function. The !CTYPE string is actually 3 tables. The first table is a bitmap table used to obtain character characteristics, the second table is a "lower to upper" case conversion table and the last entry is an "upper to lower" case conversion table. Each of the tables is 256 bytes in length.

Following are the "bitmaps" used to describe the characteristics table:

Bit

Hex Value

Meaning

0

01

Upper case alpha

1

02

Lower case alpha

2

04

Numeric

3

08

Punctuation

4

10

White space

International users may have to make changes to !CTYPE to accommodate various character sets used in different countries.

STBL("!TERMS")

The !TERMS string is used by PRO/5 during INPUT from the terminal to recognize field terminators. By default the usual terminators (CR, LF, etc.) are recognized and set the CTL value accordingly. However, developers may chose to add more terminators (such as TAB) and define additional CTL values. Each entry is a 2-byte pair, the first byte indicates a desired field terminator and the second byte indicates the corresponding CTL value to be returned for that character. This string is used by the INPUT verb but not by editors (such as INPUTE).

A typical application would be to add the tab character to the list in the following manner:

1000 A$=STBL("!TERMS")
1010 IF POS($09$=A$,2)=0 THEN
1010:A$=STBL("!TERMS",A$+$0900$)

The example adds the tab character as a separator (if it wasn't already there) returning a CTL value of 0.

STBL("!IRULES")

The !IRULES entry affects the behavior of the INPUTN verb, and uses the following hex values:

Flag Bit

Effect on Input if Bit is Set

$01$

Digits are entered from the right-most position. Normally, input begins to the left of the decimal point in the input mask and proceeds past the decimal only when "." is entered.

$02$

Commas and numeric characters are copied when generating the edit mask.

$04$

Accepts the decimal point replacement character for data entry defined by SETOPTS(6,1).

$80$

Causes the system to beep upon entry of invalid data.

The values are additive. For example the following causes digits to be entered from the right most position, and causes the system to beep upon entry of invalid data.

1000 A$=STBL("!RULES",$81$)

STBL("!CONEXIT")

The !CONEXIT entry forces PRO/5 to exit the application the next time the application stops running.

STBL("!CONMESS")

The !CONMESS entry defines the message to be given before the application exits.

STBL("!CONPASS")

The !CONPASS entry defines an application password before allowing the user to work in console mode. Note that "Release" will always cause the application to exit PRO/5.

The interaction of the global strings is as follows:

!CONEXIT

!CONMESS

!CONPASS

Behavior

set

not set

not set

PRO/5 waits for the user to press the <Enter> key before exiting. The user cannot go to console mode.

set

set

not set

PRO/5 displays the message specified by !CONMESS and then waits for the user to press the <Enter> key before exiting. The user cannot go to console mode.

set

not set

set

PRO/5 displays the message: "Enter password to enter debug mode or RELEASE to exit application." The user can either enter the password or type "RELEASE" to exit PRO/5 and the application. If the user presses the <Enter> key, the message is redisplayed.

set

set

set

The message specified by !CONMESS is displayed and PRO/5 waits for the user to either enter the password to enter console mode or type "RELEASE" to exit PRO/5 and the application. If the user presses the <Enter> key the message is redisplayed.

not set

either

either

No effect if !CONEXIT is not set.

 

STBL("!THROWERROR")

In BBj 6.0 and higher, this STBL entry controls how a program handles errors when the program is allowed to drop to console (i.e., when setopts 1 $08$ is set).

If the developer allows the program to drop to console and there is an STBL entry for !THROWERROR, then when program encounters an error, BBj looks for an error handler at the current program level. If BBj cannot find an error handler, BBj pops the program stack until it finds an error handler or until it reaches level zero. Once it finds a program handler, execution proceeds under the control of the error handler. However, because the program allows dropping to console, the error handler will stop if it encounters an ESCAPE or if the user BREAKs the program.