HPlogo Using KSAM XL and KSAM 64 > Appendix B BASIC/V Intrinsics

BKERROR

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

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$,M$)
  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

In another example, BKERROR is called to retrieve the message corresponding to the MPE file system error code returned when the first character of status is 9.

    10 DIM S$(4),M$(72)
    .
    .
    .
    50 IF S$(1;1)="9" THEN DO
    60 CALL BKERROR(S$,M$)
    70 PRINT"FILE ERROR";S$(2);"MEANS";M$
    80 DOEND

Suppose the value returned in status is 9172. The routine above prints the following message when the program is run:

  FILE ERROR 172 MEANS KEY NOT FOUND; NO SUCH KEY VALUE




BKDELETE


BKLOCK