9.90 GET_HELP

Note: Built-In Function Rules     Usage Options

Gets 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 that the function is defined in. 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

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

L

Req

Working list to contain help text.

List must not be more than:
32767 entries in Windows
9999 entries on IBM i.

The calling RDML function must provide a working list with an aggregate entry length of exactly 77 bytes.

Each returned list entry is formatted as follows:

Bytes 1-77: Help Text

1

77

 

 

2

A

Req

Return code

OK = list returned partially or completely filled with help text for this object No more help text exists for this object.

OV = list returned completely filled, but more help text than could fit in the list exist. Typically used to indicate "more" functions in page at a time style list displays.

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 the help text of a specific object and display it without the use of the HELP key.

********* 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

********* Request Object Name, Extension and Type

REQUEST FIELDS(#RQSOBJ)

CLR_LIST NAMED(#WKHLPL)

CLR_LIST NAMED(#BWHLPL)

********* 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)

ENDSELECT

********* Allow Help text to be reviewed for the specified object

DISPLAY FIELDS((#DSPHLP)) BROWSELIST(#BWHLPL)

********* 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