Note: Built-In Function Rules Usage Options
Puts/updates a list of help text for a specified field, function or process.
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments
|
Return Values
|
Example
A user wants to retrieve and update the help text of a specific object without going through the LANSA options provided on the "Process Control Menu" and the "Field Control Menu", that enables the user to create/change help text for fields, functions and processes.
********* Define arguments and lists
DEFINE FIELD(#OBJNAM) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#OBJEXT) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#OBJTYP) TYPE(*CHAR) LENGTH(2)
DEFINE FIELD(#HLPTXT) TYPE(*CHAR) LENGTH(77)
DEFINE FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
DEF_LIST NAME(#WKHLPL) FIELDS((#HLPTXT)) TYPE(*WORKING)
DEF_LIST NAME(#BWHLPL) FIELDS((#HLPTXT))
GROUP_BY NAME(#RQSOBJ) FIELDS((#OBJNAM) (#OBJEXT) (#OBJTYP))
GROUP_BY NAME(#DSPHLP) FIELDS((#OBJNAM) (#OBJEXT) (#OBJTYP))
********* Clear working and browse lists
BEGIN_LOOP
CLR_LIST NAMED(#WKHLPL)
CLR_LIST NAMED(#BWHLPL)
********* Request Object Name, Extension and Type
REQUEST FIELDS(#RQSOBJ)
********* Execute Built-In Function - GET_HELP
USE BUILTIN(GET_HELP) WITH_ARGS(#OBJNAM #OBJEXT #OBJTYP) TO_GET(#WKHLPL #RETCOD)
********* Help text was retrieved successfully
IF COND('#RETCOD *EQ ''OK''')
********* Move Help text from the working list to the browselist
SELECTLIST NAMED(#WKHLPL)
ADD_ENTRY TO_LIST(#BWHLPL) WITH_MODE(*CHANGE)
ENDSELECT
********* Allow Help text to be changed for the object
REQUEST FIELDS(#DSPHLP) BROWSELIST(#BWHLPL)
********* Change the help text for this object
EXECUTE SUBROUTINE(PUTHELP)
********* Working list overflowed, more help text to retrieve
ELSE
IF COND('#RETCOD *EQ ''OV''')
MESSAGE MSGTXT('List not big enough to fit all help text')
********* GET_HELP failed with errors, report error
ELSE
MESSAGE MSGTXT('GET_HELP failed with errors, try again')
ENDIF
ENDIF
END_LOOP
********* Subroutine to change help text for this object
SUBROUTINE NAME(PUTHELP)
CLR_LIST NAMED(#WKHLPL)
********* Move Help text from the browselist to the working list
SELECTLIST NAMED(#BWHLPL)
ADD_ENTRY TO_LIST(#WKHLPL)
ENDSELECT
********* Execute Built-In Function - PUT_HELP
USE BUILTIN(PUT_HELP) WITH_ARGS(#OBJNAM #OBJEXT #OBJTYP #WKHLPL) TO_GET(#RETCOD)
********* Help text was changed successfully
IF COND('#RETCOD *EQ ''OK''')
MESSAGE MSGTXT('Help text for this object has been changed')
********* PUT_HELP failed with errors, report error
ELSE
MESSAGE MSGTXT('PUT_HELP failed with errors, try again')
ENDIF
ENDROUTINE