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:
Parm | Type/Length/Dec | Description |
|---|---|---|
1 | A(1024) | Standard LANSA information data structure |
2 | A(2048) | Standard LANSA exchange data structure |
3 | A(1) | Error return area. Passed in as "N" (no errors). Return as "Y" (error occurred) if a fatal error occurs in the exit program. |
4 | A(1) | Update flag. Passed in as "N" (no updates). Return as "Y" (updates performed) if LANSA is to update the details from the returned data. |
5 | A(3) | Type of help text being edited. |
6 | A(10) | Name of field or process involved. Passed for "FLD", "PRO" and "FUN" edits. |
7 | A(7) | Name of function involved. Passed for "FUN" edits. Passed as blanks for others. |
8 | A(10) | Name of work file being used by LANSA. The work file is a temporary unkeyed data file with a record length of 77 bytes. |
9 | A(10) | Library in which work file resides. |
10 | A(10) | Name of member containing the help text. |
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: |
| Assign shared folder to drive J |
| Execute your favorite PC editor over the file containing the help text. |
| Release the folder from drive J |