| 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" |