HP 3000 Manuals

##printerror [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation


VIRTUOSO CODE GENERATOR Reference Manual

#printerror 

Writes a message to the generator listing file.

Syntax 

     #printerror message="string" type="msg-type"

Keyword 

string           is the message to be printed to the listing file.  The
                 string can be a keyword value or a literal string.  Both
                 must be enclosed in quotes.  Parameter replacement will
                 be performed before the statement is executed.  This
                 allows a keyword value to appear as the argument to the
                 construct.  The string will be truncated after 80
                 characters when written to the listing file.  That is,
                 the string should not exceed 80 characters.

msg-type         specifies the type of message that is to be printed to
                 the listing file.  The valid message types are:
                   ERROR
                   WARN

                 A total of Errors and Warnings is maintained by the
                 Virtuoso Generator; the specification of ERROR or WARN
                 increments this total.

Description 

You can use the #printerror construct to print messages in the listing
file.  The messages are printed in the following format based on the
message type:

     **** ERROR #  1  User ERROR Message specified (VIR 1056)
     **** USER ERROR  : error-message 

     **** WARNING #  1  User WARNING Message specified (VIR 1057)
     **** USER WARNING :warning-message 

Typical usage for the construct is in the verification of the integrity
data retrieved from the dictionary.  For example, if a model expects a
specific number of relationships, the #printerror construct can be used
(in conjunction with the #if construct) to write an error message to the
listing file when too many or too few relationships are retrieved.

Examples 

     #for module="!module" image-database=? relclass="processes"
        .
        .
        .
     #  if loopcounter > 2
     #     printerror message="Too many databases defined for module !module" &
     #                type="ERROR"
     #  endif
     #endfor

The example illustrates the use of the #printerror construct to generate
an error in the listing file.  The error occurs when more databases than
expected are retrieved from the dictionary for a specific module.



MPE/iX 5.0 Documentation