Constructor Statement

Initializes the data of a new instance of an object.

Syntax

Usual construct

Constructor [ parameter_list ]
    [ statements ]
End [ Constructor ]

Var construct

Constructor { Dim | Var }
    statements
End [ Constructor ]

Parts

Dim
Used with the “Var construct”. Specifies that variables declared in statements are both parameters and members of the parent construct. The arguments that you supply automatically assign values to the members. Such a constructor must come before usual constructors.
Var
Same as Dim.
parameter_list
Optional in the usual construct. See Parameter List for more information.
Not permitted in the Var construct.
statements
Optional in the usual construct – Executable statements.
Required in the Var construct – One or more variable declaration statements.
End
Completes the statement. You can also use End Constructor.

Instructions

ViviFire permits multiple constructors in an object. Each constructor must have a different parameter signature.

All constructors must be in a group together. They come after a possible data section and before a possible destructor or other procedures.

You can think of the data section as a type of constructor. Statements you put in this section execute before a Constructor.

Permitted parents

Changes in syntax with @Option

There are two areas where you can change the syntax of the statement:

See @Option Directive for more information.

Examples

TODO

See also