| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > QueryFormClass > QueryFormClass Methods >====== Ask (solicit query criteria) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[queryformclass functional organization expected use.htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[init initialize the queryformclass object .htm|{{btn_next_n.gif|Next page}}]] | | || **Ask( **[ //uselast //] **), VIRTUAL, PROC** {{blk2blue.jpg|blk2blue.jpg}} | **Ask** | Accepts query criteria (search values) from the end user. | | //uselast// | An integer constant, variable, EQUATE, or expression that determines whether the QueryFormClass object carries forward previous query criteria. A value of one (1 or True) carries forward input from the previous query; a value of zero (0 or False) discards previous input. | The **Ask **method displays a query dialog, processes its events, and returns a value indicating whether to apply the query or abandon it. A return value of Level:Notify indicates the QueryFormClass object should apply the query criteria; a return value of Level:Benign indicates the end user cancelled the query input dialog and the QueryFormClass object should not apply the query criteria. **Implementation:** The Ask method declares a generic (empty) dialog to accept query criteria. The Ask method calls the QueryFormClass object's WindowManager to define the dialog and process it's events. The GetFilter method generates filter expressions using the search values set by the Ask method. The Init method sets the value of the QueryFormClass object's WindowManager. **Return Data Type:     **BYTE **Example:** **MyBrowseClass.TakeLocate PROCEDURE** **CurSort USHORT,AUTO** **I USHORT,AUTO** ** CODE** ** IF ~SELF.Query&=NULL AND SELF.Query.Ask()** **  CurSort = POINTER(SELF.Sort)** **  LOOP I = 1 TO RECORDS(SELF.Sort)** **   PARENT.SetSort(I)** **   SELF.SetFilter(SELF.Query.GetFilter(),'9 - QBE')** **  END** **  PARENT.SetSort(CurSort)** **  SELF.ResetSort(1)** ** END** **See Also:**     [[getfilter return filter expression .htm|GetFilter]], [[init initialize the queryformclass object .htm|Init]], [[queryformvisual.htm|QueryFormVisual]]