The STBL() function allows the program to maintain strings that are independent of the workspace and cannot be destroyed by CLEAR, BEGIN, or START. However, these strings are not shared between tasks. The STBL() function is used to maintain these global strings. There are two forms of the STBL() function:
Assign global string
The following example creates a global string called "NAME" and gives it the current value of B$. The STBL() function returns the value of B$ as its result. The string name (or "tag") may be any character sequence up to 32 characters. The value stored in a global string may be any length. If a global string with the same name already exists, it is overwritten with the new value.
1000 LET DUMMY$=STBL("NAME",B$)
Retrieve global string value
The following example locates a global string called "NAME" and returns its value to A$.
2000 LET A$=STBL("NAME")
Some special housekeeping operations are also supported:
The following removes the string called "NAME" from the global string area.
1000 LET DUMMY$=STBL("!CLEAR","NAME")
The following removes the string called "NAME" and any other strings that were created or updated since "NAME" was last assigned. This allows an application to "mark" the global string list and clean up later, if desired.
1000 LET DUMMY$=STBL("!CLEARTO","NAME")
The following example returns a list of all names in the global string area. The names are in most recent to oldest order, separated with $00$.
1000 LET DUMMY$=STBL("!LIST")
The following removes all global strings (with the exceptions below).
1000 LET DUMMY$=STBL("!CLEARALL")
In addition to maintaining small amounts of data for use by several applications, STBL() allows PRO/5 to be customized (such as loading foreign language upper/lower case tables). Read more about these customizations in the STBL Formats section of the User's Reference Guide and use string names beginning with a "!". Therefore, avoid names beginning with "!". Global strings with names that begin with "!" will not be removed by "!CLEARTO" or "!CLEARALL" but can be removed individually with "!CLEAR".
The following loads the field terminator table.
The following loads the character type and case table.
The following sets PRO/5's editor command table.
The following sets PRO/5's date string table.