Occurs when an object is created.
Syntax
PROCEDURE Object.Init
[LPARAMETERS Param1, Param2,...]
Arguments
Param1, Param2...
Parameters are optional, but if parameters are passed, you must include an LPARAMETERS or PARAMETERS statement that lists each parameter. Otherwise, Visual FoxPro generates an error.
Remarks
For form sets and other container objects, the Init events for all the contained objects are triggered before the container's Init event, so you can access the contained objects within the container's Init event. The Init event for each contained object occurs in the order it was added to the container object.
To prevent a control or an Active Document from being created, return false (.F.) from the Init event. The Destroy event will not be triggered. For example, the following code returns false (.F.) if the Invoice table is not available:
PROCEDURE INIT
IF NOT FILE("INVOICE.DBF")
ERROR 'Initialization Failed: File not found'
RETURN .F.
ELSE
USE INVOICE IN 0 AGAIN
THIS.WorkArea = SELECT()
ENDIF
ENDPROC