VERRMSG [ HP Data Entry and Forms Management System (VPLUS/V) ] MPE/iX 5.0 Documentation
HP Data Entry and Forms Management System (VPLUS/V)
VERRMSG
Returns a message corresponding to the error number of an edit error or
an intrinsic call error.
Syntax
VERRMSG {comarea,buffer,buflen,actualen}
Parameters
comarea Must be comarea named when forms file was opened with
VOPENFORMF. If not already set, the following comarea
items must be set before calling VERRMSG:
language Set to code identifying the programming
language of the calling program.
comarealen Set to total number of two-byte words
in comarea.
errfilenum Contains MPE file number of VPLUS/V
error message file; should be
initialized to zero so that VERRMSG can
open the error message file.
(Note that cstatus must not be cleared before calling
this intrinsic.)
VERRMSG may set the following comarea items:
errfilenum If initialized to zero, VERRMSG opens
VPLUS/V error message file and sets
errfilenum to MPE file number of the
opened file.
buffer Character string in an application to which message is
returned by VERRMSG. In order to contain the message,
this buffer must be defined as at least 72 bytes long.
buflen Two-byte integer variable set by an application to the
length of the buffer.
actualen Two-byte integer to which VERRMSG returns the number of
bytes in the message sent to buffer.
Discussion
If an error occurs in an intrinsic call or is detected by a VPLUS/V edit,
a call to VERRMSG returns the message associated with the error. For an
intrinsic call error, cstatus is set to a nonzero value. If cstatus
indicates an error, VERRMSG returns the text explaining the type and
cause of the error. If VINITFORM, VFIELDEDITS, or VFINISHFORM detects a
data error, cstatus is set to zero and numerrs is set to a nonzero value.
If numerrs is set, VERRMSG returns a custom error message if there is
one; otherwise, it returns the VPLUS/V error message associated with the
edit error number in the VPLUS/V error message file. The error message,
custom or VPLUS/V, is returned for the first field flagged in error.
The message describing the error is returned to an application in the
area defined by the buffer parameter. The message length can be no
longer than buflen; the actual length of the message is returned in
actualen. You can then call VPUTWINDOW to move this message to the
window area of memory for later display at the terminal.
The errfilenum contains the MPE file number of the VPLUS/V error message
file. This file contains the error numbers and their associated messages
for both intrinsic call and edit errors. It does not contain custom
error messages, which are retrieved by VERRMSG through the form
definition. VERRMSG opens this file if errfilenum equals zero when
VERRMSG is called; it then sets errfilenum to the MPE file number of the
file. The file is closed automatically when an application terminates.
If the VPLUS/V error message file cannot be opened and read by this
intrinsic, default messages are generated. If cstatus is not equal to
zero, the message is:
"VPLUS Error, COM'STATUS is nnn".
If cstatus is zero and numerrs is greater than zero, the message is:
"VPLUS Edit Error nnn".
Example
COBOL
CALL "VERRMSG" USING COMAREA, BUFFER, BUFLEN, ACTUALEN.
BASIC
225 CALL VERRMSG(C(*),M$,L,M)
FORTRAN
CALL VERRMSG(COMAREA,BUFFER,BUFLEN,ACTUALEN)
SPL/PASCAL
VERRMSG(COMAREA,BUFFER,BUFLEN,ACTUALEN);
Assume that filerrnum contains an MPE file error code. The calls to
VERRMSG shown above return to your application a message describing the
error and the length of this message in bytes.
MPE/iX 5.0 Documentation