W3Schools

home HOME

VBScript Tutorial
VB HOME
VB Introduction
VB How to
VB Where to
VB Variables
VB Procedures
VB Conditional
VB Looping
VB Summary

Examples
VB Examples

References
VB Functions
VB Keywords

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Forum

Helping W3Schools

VBScript CBool Function


VBScript Reference Complete VBScript Reference

The CBool function converts an expression to type Boolean.

Syntax

CBool(expression)

Parameter Description
expression Required. Any valid expression. A nonzero value returns True, zero returns False. A run-time error occurs if the expression can not be interpreted as a numeric value

Example 1

dim a,b
a=5
b=10
document.write(CBool(a) & "<br />")
document.write(CBool(b))
Output:
True
True


VBScript Reference Complete VBScript Reference




Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2008 by Refsnes Data. All Rights Reserved.

Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999