Makes an instance of an object and initializes it.
[ Shared ] [ New ] class_name [ < type_list > ] #object_name [ , argument_list ] [ Begin [ default_type ] [ statements ] End [ New | class_name ] ]
- Optional – There can be only one instance.
- Necessary name of a type class.
- Optional – See “Type List” for more information.
- Necessary name for the object.
- Optional – One or more expressions with a comma between each one.
- Optional – Starts the expanded construction.
- Optional data type that the compiler will use for the subsequent statements, if the data type is ambiguous. The data type must derive from the type specified in a constructor of class_name.
- Necessary in the expanded construction – One or more object-creation statements. See the section “Permitted members” for more information.
- Completes the expanded construction. You can also use one of End New or End class_name.
- an argument list, which is treated like the arguments to a New statement
' Find all text files in current directory Files #fs, "*.txt"
' Create a menu. Menu #file, "&File", "&Open...", DoOpen, |, "E&xit", DoExit
New Menu #File, "&File" Begin "&Open...", DoOpen |---- "E&xit", DoExit End New
Menu #File, "&File" Begin "&Open...", DoOpen |---- "E&xit", DoExit End Menu