DIAdem Help

Method: CBool for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: CBool for VBS

Converts an expression into the Variant type with the Boolean subtype.

vCBool = Object.CBool(expression)
ObjectVBS
Object with this method. You do not need to specify this object.
expressionVariant
Specifies any expression.
vCBoolVariant
Receives the converted value. If the expression is 0, the method returns False, otherwise it returns True.

The following example returns various Boolean expressions:

Dim MyNumA, MyNumB, MyNumC
MyNumA = 4
MyNumB = 4
Call MsgBox(CBool(MyNumA = MyNumB)) ' Returns True
MyNumC = 0
Call MsgBox(CBool(MyNumC))          ' Returns False

See Also

Objects Overview

Related Topics

Abs | Asc | AscB | AscW | CBool | CByte | CCur | CDate | CDbl | CInt | CLng | CSng | CStr | ChrB | ChrW | Chr | Escape | Fix | Hex | Int | Oct | Sgn | UnEscape