# NEW

Variable = NEW Class [ ( constructor parameters... ) ] [ AS Name ]

instantiates the class Class. The object or class where the object is instantiated is its parent. If a name is specified, the new object will be able to raise events by calling a public procedure or function in its parent. The name of this event handler is the name of the object followed by an underscore and the name of the event.

Note : NEW is not an operator. You can only use it within an assignment.

Two differents object can have the same event name. Thus, you can manage events of multiple objects in the same event procedure, provided these objects raise the same events.

Example

    hButton = NEW Button(ME) AS "MyButton"

    ...

    PUBLIC PROCEDURE MyButton_Click()

      PRINT "My button was clicked !"

    END

Previous: New Next: NEXT