|
|||||
|
|||||
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 #process-output domain-free, declare #main-output has domain-free referents-displayed |
Related Concepts Buffering I/O Input Streams: changing modifiers on #process-output and #error |