Using KSAM/XL and KSAM 64 (32650-90886)

236 AppendixB
BASIC/V Intrinsics
BKERROR
BKERROR
A call to BKERROR returns a message corresponding to the
status
value.
CALL BKERROR (
status, message
)
Call this procedure in order to get a printable string of characters that describes the
condition that corresponds to the value of the
status
parameter. The string of ASCII
characters returned in
message
can be printed as an error message.
Parameters
status
A four-character string variable to which is returned a numeric value in
printable form following execution of any of the procedures described in
this section. The value in
status
is used to derive the text in
message
.
(
Required parameter
)
message
A string variable which will contain the text describing the error whose
code has been returned to
status
. This parameter should be dimensioned
to at least 72 characters in length. If the message length exceeds the
dimensioned length of
message
, a truncated text is provided. (
Required
parameter
)
Operation Notes
The following example illustrates the use of BKERROR. Two strings are dimensioned for
message
; one (M$) is sufficiently long, the other (N$) causes truncation of the message.
Assume that the status code in S$ is the value 22.
10 DIM S$(4),M$(72),N$(24)
20 REM..S$ IS THE STATUS STRING
30 REM..M$ IS A SUFFICIENTLY LARGE STRING
40 REM..N$ IS TOO SMALL FOR THE MESSAGE
50 REM..ASSUME S$ CONTAINS THE VALUE "22"
60 REM..
.
.
.
100 CALL BKERROR (S$,MS)
110 PRINT "ERROR";S$(1;1);"DETAIL";S$(2);"";M$
120 CALL BKERROR (S$,M$)
130 PRINT "ERROR "S$(1;1);"DETAIL";S$(2);"";N$
RUN
ERROR 2 DETAIL 2 INVALID KEY VALUE. DUPLICATED KEY VALUE
ERROR 2 DETAIL 2 INVALID KEY VALUE. DUPL