swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
built-in variable  

#error

 
 

Purpose

One of the built-in program output streams, and the standard error output stream for OmniMark.

#error always refers to a "standard error" ("stderr"), and can be used in the same manner as #process-output.

If no "-log" argument is given on the command line, OmniMark places all errors and informative messages in this stream. (Defining "-log" does not change the definition of #error; it remains the "standard error" output.) If a system does not distinguish between "standard output" and "standard error", they are defined as the same destination.

Since this stream is considered "domain free" by default, neither the domain-free modifier nor the "%z" modifier has any effect on it.

The following code illustrates the use of the #error stream for standard error reporting:

  local integer list-items
  do when number of list-items != list-count
     local integer temp
     put #error "Found a condition that shouldn't have happened:"
     set temp to number of list-items
     put #error " list-count = %d(list-count), but " _
        "list-items has %d(temp) item(s).%n"
     halt with 2 ; signals an error condition while stopping
  done

Line breaking and translation are never applied to the #error stream.

On most systems, "standard error" is unbuffered. That is, text written to it is immediately output. This can be changed using the following declaration: declare #error has (buffered | unbuffered).

The #process-output stream in OmniMark is usually buffered, which will lead to error messages appearing before output from #process-output.

By default, the #error stream in any program that uses referents is treated as if it were opened with referents-displayed.

  Related Syntax
 
Related Concepts
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.