Help Center
Help CenterFreeBASIC

#assertkeyword

Preprocessor conditional directive

Preprocessorkeyworddocumented

Syntax

#assert condition

Parameters

NameDescription
conditionA conditional expression that is assumed to be true

Description


Asserts the truth of a conditional expression at compile time. If condition is false, compilation will stop with an error.

This statement differs from the Assert macro in that #assert is evaluated at compile-time and Assert is evaluated at run-time.

Remarks

Differences from QB


  • New to FreeBASIC

See also


Example


Const MIN = 5, MAX = 10

#assert MAX > MIN '' cause a compile-time error if MAX <= MIN



Reference

  • Documented in KeyPgPpassert.html