www.lucersoft.com

   
       Home  |   News  |   Downloads  |   Order  |   Contacts

 

 

Main

Home

Site map

Products

LC Backup

LC Copier

HTML Batch Editor

HTML Batch Editor PRO

Tennis 2001

Freeware

Documentation

HTML Batch Editor PRO

LC Basic

Information

Order

Update Policy

Support

Contacts

Links

 
 
 
 

 
 
 
 
 
 
 
 
 

Bool

Language reference


Syntax

 

result = Bool (expression)


Description:

 

Converts any type of value to boolean. Boolean is an expression that evaluates to either True or False.


Examples:

' String that contains any characters is converted to True
b = Bool ( "Hello" )
' Blank string is converted to False
b = Bool ( "" )
' Number is converted to True if one is nonzero.
b = Bool ( 21 )
b = Bool ( 3.14 )
b = Bool ( -5 )
' If value contain zero is converted to False
b = Bool ( 0 )
' By the Bool() you may easy test if string is blank
string = "Hello World"
If Bool(string)
 MsgBox "String contains any characters."
Else
 MsgBox "String is blank"
Endif

 

In fact you doesn't need Bool() because LC Basic automatically converts any values in the logical expression. So that you may use right:

 

string = "Hello World"
If string
 MsgBox "String contains any characters."
Else
 MsgBox "String is blank"
Endif

 

Using Bool() as command has not effect. vis. Functions

 

String = "Hello"
Bool (String)
String is still "Hello"

See also:

 

AND operator, OR operator,XOR operator,NOT operatorIf, Else, Endif


A statement bool is a part of kernel LC Basic.

 
Last updated: November 2, 2003
Copyright © 2002 Lucersoft

Add to favorites

Back