TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
160 Chapter5
TurboIMAGE/XL Library Procedures
DBERROR
DBERROR
INTRINSIC NUMBER 419
Moves a message, as an ASCII character string, to a buffer specified by the calling
program. The message interprets the contents of the status array as set by a call to a
TurboIMAGE/XL procedure.
Syntax
DBERROR,
status,buffer,length
Parameters
status
is the name of the array used as the status parameter in the
TurboIMAGE/XL procedure call about which information is requested.
buffer
is the name of an array in the calling program's data area, at least 36
halfwords long, in which the message is returned.
length
is a short, 16-bit integer variable which is set by DBERROR to the positive
byte length of the message placed in the buffer array. The length will never
exceed 72 characters.
NOTE
The call to DBERROR must be made immediately after receiving an error status
before any other intrinsics are executed to ensure the display of valid
messages.
Discussion
Like DBEXPLAIN, DBERROR messages are appropriate and helpful when debugging
application programs. The errors they describe are, for the most part, errors that do not
occur in a debugged and running program.
Some errors or exceptional conditions are expected to occur, even in a production
environment. For example, the MPE/iX intrinsic DBOPEN can fail due to concurrent
database access. In this case, printing the following DBERROR message:
DATABASE OPEN EXCLUSIVELY
can be perfectly acceptable, even to the person using the application program. However, in
many cases a specific message produced by the application program is preferable to the
one produced by DBERROR. A DBFIND error generated by the application program, such as:
THERE ARE NO ORDERS FOR THAT PART NUMBER
would be more meaningful to a user entering data at a terminal than the DBERROR
message:
THERE IS NO CHAIN FOR THE SPECIFIED SEARCH ITEM VALUE