What are #error and #stdout directives ?
#error : Generate a compiler error and display a message
Syntax :
#error [<messageText>]
Arguments :
<messageText> is the text of the message to be displayed. <messageText> is a literal character string–do not enclose the message in quotations unless you want them to appear as part of the display.
Description :
#error causes the compiler to generate error number C2074. If the <messageText> parameter is specified, an error message is displayed.
Examples :
. This example displays an error message based on whether or not a NETWORK identifier was defined:
#ifdef NETWORK #error Network version not implemented. #endif
~~~~~~~~~~~~~~~~~~~~~~~
#stdout : Send literal text to the standard output device
Syntax :
#stdout [<messageText>]
Arguments :
<messageText> is the text of the message to display. <messageTest> is a literal character string. Do not enclose the message in quotation marks unless you want them to appear as part of the display.
Description :
#stdout causes the compiler to output the literal text to the standard output device (stdout) during compilation. If <messageText> is not specified, a carriage return/line feed pair echoes to stdout.
Warning! Manifest constants are not translated in #stdout. Implementation is identical to #error with the following exceptions: output is written to STDOUT and no compiler error is generated.
Examples :
This example demonstrates use of #stdout:
#ifdef DEBUG #stdout Compiling debugging version... #endif
PROCEDURE Main()
? "Hello world"
RETURN
#stdout End of "Hello World" program