Assert

Debugging macro that halts program execution if an expression is evaluated 
to 0 (false).

Syntax
	KeyPgPpdefine#define Assert(expression) KeyPgIfthenIf (expression) = 0 KeyPgThenThen : fb_Assert( KeyPgDdfile__FILE__
	, KeyPgDdline__LINE__, KeyPgDdfunction__FUNCTION__, KeyPgOpPpStringize#expression ) : KeyPgEndifEnd If

Usage
	Assert( expression )

Parameters
	expression
		Any valid conditional/numeric expression.  If expression evaluates to 
		0 (i.e. "false"), execution is halted.

Description
	The Assert macro is intended for use in debugging and works only if the 
	CompilerOpteassert-g or CompilerOpteassert-eassert option is specified on the fbc command line. In this case 
	it prints an error message and stops the program execution if expression 
	evaluates to 0.

	Its normal use is to check the correct value of the variables or 
	expressions during debugging.

	If CompilerOpteassert-g and CompilerOpteassert-eassert are not passed to fbc, the macro does not generate 
	any code, and has no effect.

	Note: If an Assert fails while the program is in a graphics 
	KeyPgScreengraphicsScreen (Graphics), the error message will not be visible as it will be 
	printed to the graphics screen, which will be closed immediately after.

Example
	Sub foo
	 Dim a As Integer
	 a=0
	 Assert(a=1)
	End Sub

	foo 

	'' If -g or -eassert is used, this code stops with: test.bas(3): assertion failed at FOO: a=1 

Dialect Differences
	* Not available in the CompilerOptlang-lang qb dialect unless referenced with the 
	  alias __ASSERT.

Differences from QB
	* New to FreeBASIC

See also
	* KeyPgPpassert#assert
	* KeyPgAssertwarnAssertWarn
	* CompilerOpteassertCompiler Option: -eassert
	* CompilerOptgCompiler Option: -g

