User Exit UEX@0002 - an Alternative Help Text Editor
User exit program UEX@0002 is provided to allow an alternative means of editing field, process or function help text.
If the option to use this alternative editor is enabled in the system definition data area DC@A01, and the user indicates that it should be used by selecting it in the check box that appears when beginning the help text edit, all edit requests will be directed to user exit program UEX@0002 instead of the standard IBM supplied EDTSRC/SEU editor.
Set up this option Enable alternate editor user exits in Compile and Edit Settings.
When UEX@0002 is called, it is passed the following parameters by the LANSA calling program DC@P1002:
|
An example of how program UEX@0002 could be used follows. This CL (control language) program is used in conjunction with IBM's PC support to allow help text to be edited on a PC using any normal PC editor or word processor.
CL Program UEX@0002 - Edit Help Text on PC Under PC Support
UEX@0002: PGM (&DC@IDS &DC@EDS &ERROR &UPDATED &TYPE &FLDPRO
&FUNCTION &FILE &LIB &MEMBER)
/* Declare all parameters and work variables (not described) */
/* Create a shared folder for this IBM i job */
RTVJOBA JOB(&JOB)
CHGVAR &FOLDER (&JOB *TCAT '.HLP')
CRTFLR FLR(&FOLDER) TEXT('Temp help work folder only')
MONMSG (CPF0000 MCH0000)
/* Copy details into the file in the shared folder */
CPYTOPCD FROMFILE(&LIB/&FILE) TOFLR(&FOLDER)
FROMMBR(&MEMBER) TODOC(&MEMBER) REPLACE(*YES)
/* Set up PC command details and execute PC editor .BAT file */
CHGVAR &PCCMD ('MYEDIT' *BCAT &FOLDER *BCAT &MEMBER)
STRPCCMD PCCMD(&PCCMD) PAUSE(*NO)
/* At end of edit, copy back into LANSA work member and */
/* then set the updated and error flags before ending */
CPYFRMPCD FROMFLR(&FOLDER) TOFILE(&LIB/&FILE)
FROMDOC(&MEMBER) TOMBR(&MEMBER) MBROPT(*REPLACE)
CHGVAR &UPDATED 'Y'
CHGVAR &ERROR 'N'
ENDPGM
Example
PC/DOS MYEDIT.BAT Batch Command File Used on the PC
These commands: |
do this: |
FSPC ASSIGN J: %1 |
Assign shared folder to drive J |
ED J:%2 |
Execute your favourite PC editor over the file containing the help text. |
FSPC RELEASE J: |
Release the folder from drive J |