RETURNPAK [ High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual ] MPE/iX 5.0 Documentation
High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual
RETURNPAK
Returns information about a Hi-Li call to the application.
Parameter Descriptions
returnstatus A four-byte integer that indicates the status
code returned by the intrinsic. The following
ranges indicate the status:
0 = successful
<0 = error (programming or system problem)
>0 = exception (operator or data problem)
sublayerstatus A four-byte integer that indicates the status
code returned by the underlying facilities.
This information is intended to augment
returnstatus for diagnostic purposes only.
returnmsglen A four-byte integer that indicates the length
in bytes of returnmsg.
returnmsg A 256-byte character array that represents a
displayed message returned by the intrinsic.
lastitemtype A four-byte integer that indicates what type of
item terminated the read intrinsic. A zero (0)
means the read intrinsic was terminated by the
[ENTER] key or a function key. A one (1) means
the read intrinsic was terminated by a field.
lastitemnum A four-byte integer that indicates the
identifier, that is number, of the function key
or field that terminated the read intrinsic.
For fields, this is the field number FORMSPEC
assigns the field. For the [ENTER] key, the
value is zero. For function keys, the value
corresponds to the function number: f1 = 1,
2 = 2, and so on.
lastitemname A 32-byte character field that represents the
USASCII name of the item that terminated the
read intrinsic. What this variable contains
depends on the item:
- field contains a field name
ENTER key shows $ENTER
function key contains $PFK_n where n is the key
number
If the item is not one of the above, lastitem
contains $VACANT.
You can define a string up to 32 characters
long to replace the itemname returned. For an
example of how to do this, see the Discussion
for the returnpak parameter.
numdataerrs A four-byte integer that indicates the number
of data errors detected during data
initialization, editing, or reformatting.
numchngdflds A four-byte integer returned by HPDREAD that
indicates the number of fields into which the
operator keyed data. A returned value of -1
means information cannot be determined.
Discussion
The returnpak parameter is initialized by the called intrinsic and
returns status information when that intrinsic is executed. This status
information is only kept until the next intrinsic is executed. For
example, if an error message is returned and you call the next intrinsic
before responding to the message, the message is lost.
Writing Replacement Strings for LASTITEMNAME
You can choose to replace the name associated with the last item with a
string you have defined. You define replacement strings in FORMSPEC by
constructing custom error messages that are retrieved by the HPDREAD
intrinsic, but not executed. For example, to write a replacement string
for the function key f3 within the form ADD_PART, write a processing
specification statement for any of the fields in form ADD_PART:
IF fieldname NE fieldname THEN
FAIL "$PFK_3 = replacement string"
This statement will never execute because the field will never be unequal
to itself. "PFK_3" is the entry key that the HPDREAD intrinsic matches
on if the function key f3 terminates the read. All text to the right of
the "equals" sign up to 32 characters is copied to lastitemname, to be
returned to the application.
Examples
COBOL:
01 returnpak.
05 returnstatus pic s9(8) comp.
05 sublayerstatus pic s9(8) comp.
05 returnmsglen pic s9(8) comp.
05 returnmsg pic x(256).
05 lastitemtype pic s9(8) comp.
05 lastitemnum pic s9(8) comp.
05 lastitemname pic x(32).
05 numdataerrs pic s9(8) comp.
05 numchngflds pic s9(8) comp.
FORTRAN:
INTEGER*4 RETURNPAK(79)
INTEGER*4 RETURNSTATUS, SUBLAYERSTATUS,
RETURNMSGLEN
CHARACTER*252 RETURNMSG
CHARACTER*4 MSGTAIL
INTEGER*4 LASTITEMTYPE, LASTITEMNUM
CHARACTER*32 LASTITEMNAME
INTEGER*4 NUMDATAERRS, NUMCHNGFLDS
EQUIVALENCE (RETURNPAK(1), RETURNSTATUS),
+ (RETURNPAK(2), SUBLAYERSTATUS),
+ (RETURNPAK(3), RETURNMSGLEN),
+ (RETURNPAK(4), RETURNMSG),
+ (RETURNPAK(67), MSGTAIL),
+ (RETURNPAK(68), LASTITEMTYPE),
+ (RETURNPAK(69), LASTITEMNUM),
+ (RETURNPAK(70), LASTITEMNAME),
+ (RETURNPAK(78), NUMDATAERRS),
+ (RETURNPAK(79) NUMCHNGFLDS)
Pascal:
type
returnpak_rec = record
returnstatus : integer;
sublayerstatus : integer;
returnmsglen : integer;
returnmsg : packed array [1..256] of char;
lastitemtype : integer;
lastitemnum : integer;
lastitemname : packed array [1..32] of char;
numdataerrs : integer;
numchngflds : integer;
end;
var
returnpak : returnpak_rec;
MPE/iX 5.0 Documentation