@Error and @Warn Directives

Cause custom compiler errors and warnings.


@Error message
@Warn message


A string literal with the text to show.


The directive @Warn causes the compiler to show a warning message. The message usually is a warning that there is a possible problem in the code. A warning usually does not stop the compiler.

The directive @Error shows an error message from the compiler. You cannot ignore an error message, because it always causes the compiler to stop.

Usually you use the directives @Warn and @Error in conditional compilation directives (@If…@Else). There could be unusual conditions when it is applicable to give a warning of some problem without condition. But we do not recommend it.


@If Win32
  ' Windows-only code goes here.
@ElseIf Linux Or MacOS
  ' Unix-like code goes here.
@Error "Platform not supported"

See also