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

Chapter 6 347
USING VPLUS INTRINSICS
INTRINSIC DESCRIPTIONS
VSETERROR
Sets the error flag of a specified field and increments
numerrs
. If this is the first field (in
screen order) with an error, it copies a message to the window area of memory for later
display.
Syntax
VSETERROR {
comarea,fieldnum,message,msglen
}
Parameters
comarea
Must be
comarea
name specified when the forms file was opened with
VOPENFORMF. If not already set, the following
comarea
items must be set
before calling VSETERROR:
cstatus
Set to zero.
language
Set to the code identifying the programming language of
the calling program.
comarealen
Set to total number of two-byte words in
comarea
.
VSETERROR may set the following
comarea
items:
numerrs
Contains number of fields in form with errors;
incremented by VSETERROR.
cstatus
Set to nonzero value if call unsuccessful.
fieldnum
Two-byte integer variable containing the field number or screen order
number of the data field to be flagged for error. If it is the screen order
number, it must be a negative number representing the position of the
field on the form.
message
Character string containing an error message to be copied to the window
area of memory for subsequent display by VSHOWFORM.
length
Two-byte integer containing the length in bytes of the message parameter.
If length is set to -1, the current content of the window is not changed. If
length is set to zero, the current content of the window is cleared to blanks.
Discussion
This intrinsic can be called by any program that wants to perform its own edits, either in
addition to, or instead of VFIELDEDITS. VSETERROR sets the error flag associated with the
specified field. If this is the first time this field has been diagnosed as having an error,
VSETERROR increments
numerrs
; otherwise, it does not change
numerrs
. Thus, if a field has
an error detected by a prior call to VFIELDEDITS, a call to VSETERROR for that field does not
increment
numerrs
. However, if the touch feature is enabled, VSETERROR
toggles
the error
flag for a specified field to clear, if it was already set, and decrements
numerrs
. Refer to
"Coding the Touch Feature" in Appendix E.
If this is the first field in the form (in screen order) that has an error, the specified message
is copied to the window area of memory for later display. If you do not want to change the
current contents of the window, set the length parameter to -1. To clear a message, set
length to zero.