Skip to content

#ERROR


Preprocessor diagnostic directive

Syntax

` #error error_text

`

Parameters

error_text

The display message

Description

#error interrupts compiling to display error_text when compiler finds it, and then parsing continues.

This keyword must be surrounded by an #if <condition> ...#endif, so the compiler can reach #error only if <condition> is met.

In any case, the final status will be "Failed to compile".

Examples

start GeSHi

vb
#define c 1

#if c = 1
  #error Bad value of c
#endif

end GeSHi

Differences from QB

  • New to FreeBASIC

See also

  • #if
  • #print
  • #assert

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft