CBool

Converts numeric or string expression to a boolean (KeyPgBooleanBoolean)

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction CBool ( KeyPgByvalByVal expression KeyPgAsAs DataTypedatatype ) KeyPgAsAs KeyPgBooleanBoolean

	KeyPgTypeType typename
		KeyPgDeclareDeclare KeyPgOperatorOperator KeyPgCastCast ( ) KeyPgAsAs KeyPgBooleanBoolean
	End Type

Usage
	result = CBool( numeric expression )
	result = CBool( string expression )
	result = CBool( user defined type )

Parameters
	expression
		a numeric, string, or user defined type to cast to a KeyPgBooleanBoolean value
	datatype
		any numeric, string, or user defined type
	typename
		a user defined type

Return Value
	A KeyPgBooleanBoolean value.

Description
	The CBool function converts a zero value to KeyPgFalseFalse and a non-zero value 
	to KeyPgTrueTrue.

	The name can be explained as 'Convert to Boolean'.

	If the argument is a string expression, it is converted to boolean using 
	a case insensitive to the string "false" to return a KeyPgFalseFalse value or 
	"true" to return a KeyPgTrueTrue value.

Example
	' Using the CBOOL function to convert a numeric value

	'Create an BOOLEAN variable
	Dim b As Boolean

	'Convert a numeric value
	b = CBool(1)

	'Print the result, should return True
	Print b
	Sleep

Version
	* Since fbc 1.04.0

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

Differences from QB
	* New to FreeBASIC

See also
	* KeyPgCbyteCByte
	* KeyPgCubyteCUByte
	* KeyPgCshortCShort
	* KeyPgCushortCUShort
	* KeyPgCintCInt
	* KeyPgCuintCUInt
	* KeyPgClngCLng
	* KeyPgCulngCULng
	* KeyPgClngintCLngInt
	* KeyPgCulngintCULngInt
	* KeyPgCsngCSng
	* KeyPgCdblCDbl
	* KeyPgStrStr

