HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)

278 Chapter6
USING VPLUS INTRINSICS
INTRINSIC DESCRIPTIONS
If the number of bytes specified by
buflen
is less than the field size, the rightmost bytes
are truncated. If the requested field has an error, its value is returned, but
cstatus
is set
to an error number indicating the field error flag is set.
Following a successful transfer,
actualen
contains the exact number of bytes transferred
to
fieldbuf
, the user buffer;
nextfldnum
is set to the number of the next field in screen
order, or to zero after the last field is processed.
Note that VGETFIELD does not convert the data it moves. If you want to convert the field,
you must use VGETtype, where type specifies the data type to which the field is converted.
Example
COBOL
DATA DIVISION.
77 ORD-LEN PIC S9(4)COMP.
77 ITEM-LEN PIC S9(4)COMP.
77 FIELD-NUM PIC S9(4)COMP.
77 ACTUAL-LENGTH PIC S9(4)COMP.
77 NEXT-FIELD PIC S9(4)COMP.
01 ORDER-ENTRY.
03 PART-NO PIC X(8).
03 UNIT-PR PI C 9 (4) V9 (2).
03 QUANTITY PIC S9(4)COMP.
03 TOTAL-PR PIC 9(5)V9(2).
03 PART-DESCR PIC X(12). <- field number "2"
:
:
PROCEDURE DIVISION.
:
:
MOVE 12 TO ITEM-LEN.
MOVE 2 TO FIELD-NUM.
CALL "VGETFIELD" USING COMAREA, FIELD-NUM, PART-DESCR OF ORDER-ENTR,
ITEM-LEN, ACTUAL-LENGTH, NEXT-FIEL.
BASIC
350 F1=2
355 L1=12
360 CALL VGETFIELD(C(*),F1,P$,L1,A1,N1)
FORTRAN
FIELD=2
LEN=12
CALL VGETFIELD(COMAREA,FIELD,PARTDES,LEN,LENFLD,NXTFLD)
SPL/PASCAL
INTEGER
FIELD,
LEN;
BYTE ARRAY PARTDES(0:11);
:
:
FIELD:=2;
LEN:=12;