In this topic:
The Null was introduce in AskiaScript to manage the communication with third-party system (like a JSON Web Service) that uses it.
In regular AskiaScript usage, the Null value/type is not intended to be used.
Null remain limited, we decide to treat it as full type by itself.Null.
Null is a type of variable (with a unique value), once a variable is assigned to null, his value could not be changed.
Dim myValue = null myValue.TypeOf() ' => "null" myValue = 1 '=> COULD NOT WORK, because the type is different
Null is a type of variable, it could not be assigned to another type of variable, except the Variant (as many AskiaScript type)
Dim myValue As String myValue = Null ' => COULD NOT WORK, because the type is different
Dim myValue As Variant myValue = Null ' => This one works
Assign a Null value to a variable.
Dim valueA = Null
Always returns "null"
Return a String
dim MyVariable = Null MyVariable.ToString() ' => "null"
Always returns "null"
Return a String
dim MyVariable = Null MyVariable.TypeOf() ' => "null"
| Name | Symbol / Expression | Description | Example |
|---|---|---|---|
| Equal | = | Test if the type (or value) of the variable is null Returns a boolean |
dim i as variant (i = null) ' => True Because the value of j is not defined |
| Different | <> | Test if the type (or value) of the variable is not null Returns a boolean |
dim i as variant (i <> null) ' => False Because the value of j is not defined |