9.163 PUT_HELP

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

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Object name

The name of a field, function or process.

1

10

 

 

2

A

Req

Object extension name

If the object type is a function then this value should contain the name of the process in which the function is defined. If the object type is not a function then this value should be blank.

1

10

 

 

3

A

Req

Object type

Values:

DF - Field

PD - Process

PF - Function

2

2

 

 

4

L

Req

Working list to contain help text. The calling RDML function must provide a working list with an aggregate entry length of exactly 77 bytes.

Each list entry sent should be formatted as follows:

From - To   Description

1 - 77   Help Text

1

77

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return code

OK = help text put/updated to database successfully.

ER = argument details are invalid or an authority problem has occurred.

In case of "ER" return code error message(s) are issued automatically.

2

2

 

 

 

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