BSL Keywords

The following table explains how to use BSL keywords.

Table 11-23 BSL Keywords

Keyword Description
Empty The Empty keyword is used to indicate an uninitialized variable value. This is not the same thing as Null.
False The False keyword has a value equal to 0.
Nothing The Nothing keyword in BSL is used to disassociate an object variable from any actual object. Use the Set statement to assign Nothing to an object variable. For example:
Set MyObject = Nothing
Several object variables can refer to the same actual object. When Nothing is assigned to an object variable, that variable no longer refers to any actual object. When several object variables refer to the same object, memory and system resources associated with the object to which the variables refer are released only after all of them have been set to Nothing, either explicitly using Set, or implicitly after the last object variable set to Nothing goes out of scope.
Null The Null keyword is used to indicate that a variable contains no valid data. This is not the same thing as Empty.
True The True keyword has a value equal to -1.

The following example illustrates the use of the Keywords:

Example 1:

Dim MyVar, MyCheck
MyCheck = IsEmpty(MyVar)
'Output -> True
MyVar = Empty             .
MyCheck = IsEmpty(MyVar)
'Output ->  True

Example 2:

Dim MyVar,Result
MyVar = False
Result = MyVar + 3
'Here MyVar is 0

Example 3:

Dim MyObject
Set MyObject = CreateObject("Scripting.Dictionary")   
Set MyObject = Nothing
'Output -> Nothing

Example 4:

MyVar = Null               
MyCheck = IsNull(MyVar)    
'Output -> True

Example 5:

Dim MyVar,Result
MyVar = True 
Result = MyVar + 3
'Here MyVar is -1