HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
348 Chapter6
USING VPLUS INTRINSICS
INTRINSIC DESCRIPTIONS
Note that the field number identifies a field regardless of its position in the form. Thus,
field "1" could be the third field in screen order counting from left to right, top to bottom.
Using the field order number is preferable because if the fields in a form are rearranged,
no modification to an application is necessary.
Example
COBOL
DATA DIVISION.
77 FLDNUM PIC 9(4) COMP.
77 MESSAGE PIC X(80).
77 MLENGTH PIC S9(4) COMP.
:
PROCEDURE DIVISION.
MOVE 3 TO FIELDNUM.
MOVE 22 TO MLENGTH.
MOVE "THIS FIELD IS REQUIRED" TO MESSAGE.
CALL "VSETERROR" USING COMAREA, FLDNUM, MESSAGE, MLENGTH.
BASIC
220 F1=3
225 L1=22
230 M$="THIS FIELD IS REQUIRED"
250 CALL VSETERROR(C(*),F1,M$,L1)
FORTRAN
FF=3
ML=22
MSG="THIS FIELD IS REQUIRED"
CALL VSETERROR(COMAREA,FF,MSG,ML)
SPL/PASCAL
INTEGER FF,ML;
BYTE ARRAY MESSAGE(0:21);="THIS FIELD IS REQUIRED";
:
FF:=3;
ML:=22;
VSETERROR(COMAREA,FF,MESSAGE,ML);
The examples above set error flags for field number "3" in the currently open form, and set
up the message "THIS FIELD IS REQUIRED" to be displayed if no value is entered in the
field and this is the first field (in screen order) in which an error is detected.
The following examples show how VSETERROR can be used to set error flags for a field in
error without writing a message to the window.
COBOL
MOVE 3 TO FIELDNUM.
MOVE -1 TO MLENGTH.
CALL "VSETERROR" USING COM1, FIELDNUM, MESSAGE, MLENGTH.
BASIC
220 F1=3