When you declare a variable and do not initialize it, the compiler gives it a default value.
For value types, the default value is different for each type.
For reference types, the default value is
See Value Types and Reference Types for more information.
All value types that are part of the language have a shared property (
Default) that returns the default value for its related type.
|Data Type||Default Value|
#Null is the value for an object that was not initialized.
It is used to indicate that an object is available for garbage collection, and to test if an object was initialized.
The pipe character (
|) is an alternative syntax to
You can use it when
#Null shows a separation in a list, such as a parameter list or in the statement
You can write one or more hyphens (
-) after the pipe character to help you see it when it is the only expression in a line.
This can occur with the block construct of
In the example that follows, the two statements are equivalent.
Menu #file, "&File", _ "&Open", OpenFile, |, "E&xit", ExitProgram New Menu #file, "&File" Begin "&Open", OpenFile |---- "E&xit", ExitProgram End Menu