Navigation: ABC Library Reference > QueryFormVisual > QueryFormVisual Methods >====== Init (initialize the QueryFormVisual object) ====== | |
Init, VIRTUAL, PROC
The Init method initializes the QueryFormVisual object. Init returns Level:Benign to indicate normal initialization.
The Init method “programs” the QueryFormVisual object.
Implementation:
The QueryFormClass.Ask method (indirectly) calls the Init method to configure the QueryFormClass WINDOW.
For each queryable item (defined by the QFC property), the Init method creates a series of window controls to accept search values. By default, each queryable item gets a prompt, an entry control, and an query operator button (equal, not equal, greater than, etc.).
The Init method sets the coordinates for the QueryFormClass WINDOW and for the individual controls.
Return Data Type: BYTE
Example:
MyQuery.Ask PROCEDURE(BYTE UseLast)
W WINDOW('Query values'),GRAY !declare an “empty” window
BUTTON('&OK'),USE(?Ok,1000),DEFAULT
BUTTON('Cancel'),USE(?Cancel,1001)
END
CODE
OPEN(W)
IF SELF.Win.Run()=RequestCancelled !configure, display & process query dialog
! Win &= QueryFormVisual
! Win.Run calls Init, Ask & Kill
! Win.Init configures the dialog
! Win.Ask displays dialog & handles events
! Win.Kill shuts down the dialog
RETURN Level:Notify
ELSE
RETURN Level:Benign
END
See Also: QFC