Init, Destroy
These events fire when an object is created and when it's released, respectively. They're similar to the constructor and destructor methods of other OOP languages, but differ from those because they don't actually perform the construction or destruction themselves.
Usage |
PROCEDURE oObject.Init [ LPARAMETERS [ nIndex , ] [ ParamList ] ] PROCEDURE oObject.Destroy |
This one's a documentation bug, not a product bug, we think. Like many other events, when the control that triggered it is a member of a control array (an array property holding references to objects), Init accepts a numeric parameter indicating which member of the array fired the event. Help doesn't show the nIndex parameter for Init. Destroy, on the other hand, is documented as accepting an nIndex parameter, but it's really hard to tell because it never fires at all. |
Example |
* This Init might be for a button. PROCEDURE Init LPARAMETERS cCaption, nTop, cSomethingElse This.Caption = cCaption This.Top = nTop * You need to have added a custom SomethingElse property * to the button for the next line to work. This.SomethingElse = cSomethingElse ENDPROC |
See Also |