DataBasic Reference > Statements and Intrinsic Functions > P > PRINTERR Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

PRINTERR Statement (DataBasic) (m618703+printerr_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

PRINTERR Statement

Prints error messages stored in the ERRMSG file or in a user-specified file.

Syntax

PRINTERR error-expr {FROM file-var}

Syntax Elements

error-exp An expression that evaluates to the item-id of the error message.

error-expcan also contain a list of parameters to be included in the error message; each parameter replaces an A, A(n) or R(n)message format code in the error message item. The parameters must be separated from the item-id and each other by system delimiters (attribute marks, value marks or subvalue marks, but not segment marks).

file-varThe name of the variable to which the error file was assigned using an OPEN statement. If omitted, the system ERRMSG file is used.

Comments

The PRINTERR statement allows you to print error messages without exiting the program.

Error message libraries can be kept separate from the ERRMSG file and used by the PRINTERR statement with the FROM clause.

Examples

OPEN "MYERRS" TO ERRORFILE ELSE STOP 201,"MYERRS"
.
.
X = "511":@VM:PARAMETER
PRINTERR X FROM ERRORFILE

Prints error message 511 found in the user-specified file ERRORFILE. @VM is a predefined symbol that evaluates to a value mark. PARAMETER evaluates to a text string that will be printed as part of the error message.

PRINTERR "201":@AM:"TESTFILE"

Prints message [201]'TESTFILE' IS NOT A FILE NAME  found in the ERRMSG file. @AM is a predefined symbol that evaluates to an attribute mark.

RealityV15.0Comment on this topic