Integrating the EUS
Execute the following to establish the EUS Toolkit environment:
CALL "_acu.utl","EUS"
CALL STBL("BBEXT")+"_lkeymap.utl"
Note that _acu.utl must be in the current directory or the PRO/5 PREFIX.
When using traditional input code in some software with the newer input capabilities of the EUS Toolkit, configurations for the edit keys may need to be swapped out when switching between old and new programs. There are two ways to accomplish this:
_rstold.utl |
The _rstold.utl utility restores the old keymap. When _lkeymap.utl sets up the keymap used by the EUS Toolkit, it saves the existing (!EDIT) table under the name (!OLD_EDIT). The original function key values are saved as (!OLD_FKEYS). _rstold.utl restores these tables to their proper places. |
_rsteus.utl |
The _rsteus.utl utility does for the EUS Toolkit what _rstold.utl does for traditional programs. The EUS tables are saved under the names (!OUR_FKEYS) and (!OUR_EKEYS). Do not use these names in the STBL. |
Invoke the EUS Toolkit with the following when adding a new program to an old system:
LET UNDO_EUS=0;EUS$=STBL("EUS",ERR=EUS_ERR)
EUS_ERR:
IF EUS$<>"YES" THEN
CALL BBEXT$+"_rsteus.utl" ;
LET TRASH$=STBL("EUS","YES"),UNDO_EUS=1
…
ALL_DONE:
IF UNDO_EUS THEN
CALL BBEXT$+"_rstold.utl";
LET TRASH$=STBL("EUS","NO")
An alternate method to integrate older programs is to invoke the EUS Toolkit, CALL the old program, and restore the Toolkit environment:
REM " LET'S USE THE TOOLKIT !
CALL "_acu.utl","EUS"
LET BBEXT$=STBL("BBEXT")
CALL BBEXT$+"_lkeymap.utl"
…
REM " Restore the old keymap
CALL BBEXT$+"_rstold.utl"
REM " Call the old program
CALL "MYOLDPROG"
REM "Restore the Toolkit environment
CALL BBEXT$+"_rsteus.utl"
Another alternative is to use a global string flag and modify old programs to search for this string:
CALL "_acu.utl","EUS"
LET BBEXT$=STBL("BBEXT")
CALL BBEXT$+"_lkeymap.utl"
REM " Set the EUS flag
LET TRASH$=STBL("EUS","YES")
…
REM inside non-EUS aware program
REM " Check the EUS Flag
LET TRASH$=STBL("EUS",ERR=NOT_LOADED)
IF TRASH$<>"NO" THEN
CALL STBL("BBEXT")+"_rstold.utl";
LET TRASH$=STBL("EUS","NO");
REM " Note that TRASH$ now contains "NO"
NOT_LOADED:
The appropriate method depends on the circumstances and needs. As systems evolve, more EUS-aware programs merge into applications; however, old programs can still be useful, while others are too intricate or not important enough to rewrite quickly.
Use the _cleanup.utl utility to clear EUS tables completely. This utility removes all global strings loaded by the EUS Toolkit.
If you are uncertain of what state the global string table is in and know absolutely that it needs to be in the standard PRO/5 state, perform the following commands to purge the global string area and restore it to its original state:
LET TRASH$=STBL("!CLEARALL")
PRINT 'FL',"1",'EL',"1",
The !CLEARALL command in the STBL() function clears everything but a few reserved names. This logic should be reserved for emergency situations within the application. Refer to the STBL Formats section in Chapter 6 of the User's Reference Guide for additional information on using this function.
Individual entries can be cleared by using STBL("!CLEAR",strvalue). This method is safer to use with an accurate list of items.