@Error and @Warn Directives

Cause custom compiler errors and warnings.

Syntax

@Error message
or
@Warn message

Parts

message
A string literal with the text to show.

Instructions

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.

Examples

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

See also