CBool Function


CBool Function

Syntax

     Dim result As Boolean = CBool(expression) 


expression (required; String or Numeric)

Any numeric expression or a string representation of a numeric value. The string values "True" and "False" are also supported.

Description

The CBool function converts expression to the Boolean data type.

Usage at a Glance

  • When a numeric value is converted to Boolean, any nonzero value is converted to true, and zero is converted to False.

  • If the expression to be converted is a string, the string must be capable of being evaluated as a number, or it must be "True" and "False." Any other string generates a runtime error.

  • You can check the validity of a numeric expression prior to using the CBool function by using the IsNumeric function.

  • This function does not support named arguments.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net