Skip to content

Sys.ToBoolean

boxgaming edited this page Jul 12, 2026 · 2 revisions

Converts a value to a QBasic-style boolean, -1 for true, 0 for false.
Available in release 0.11.0

Syntax

result = Sys.ToBoolean ( value )

Parameters

  • The value parameter specifies the value to convert.

Example

Import Sys From "lib/lang/system.bas"

Print Sys.ToBoolean(false)
Print Sys.ToBoolean(true)
Print Sys.ToBoolean(1 > 2)
Print Sys.ToBoolean(1 < 2)
Print Sys.ToBoolean(3)
Print Sys.ToBoolean(-5)
Print Sys.ToBoolean(0)

Output

 0
-1
 0
-1
-1
-1
 0

See Also

Sys.ToInteger
Sys.ToFloat
Sys.ToString

Clone this wiki locally