| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > QueryClass > QueryClass Methods >====== SetLimit (set search values) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[save save a query .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[setquickpopup add quickqbe to browse popup .htm|{{btn_next_n.gif|Next page}}]] | | || **SetLimit(** //name// [ ,//lower// ] [ ,//upper// ] [ ,//equal //]// //**)** {{blk2blue.jpg|blk2blue.jpg}} | **SetLimit** | Sets the QueryClass object's search values. | | //name// | A string constant, variable, EQUATE, or expression containing the queryable item to set. Queryable items are established by the AddItem method. | | //Lower// | A string constant, variable, EQUATE, or expression that specifies the filter's lower boundary--the query searches for values greater than //lower//. If you prefix the lower value with the equal sign (=), the query searches for values greater than or equal to //lower//. If omitted, SetLimit leaves the lower boundary intact. | | //upper// | A string constant, variable, EQUATE, or expression that specifies the filter's upper boundary--the query searches for values less than //upper//. If you prefix the //upper// value with the equal sign (=), the query searches for values less than or equal to //upper//. If omitted, SetLimit leaves the upper boundary intact. | | //equal// | A string constant, variable, EQUATE, or expression that specifies the filter's exact match--the query searches for values equal to //equal//. If you prefix the //equal //value with the greater sign (>), the query searches for values greater than or equal to //equal//; if you prefix the //equal //value with the less sign (<;), the query searches for values less than or equal to //equal//. If omitted, SetLimit leaves the exact match intact. | The **SetLimit **method sets the QueryClass object's search values. The GetLimit method gets the QueryClass object's search values. **Implementation:** The GetFilter method generates filter expressions using the search values set by the Ask method, the SetLimit method, or both. {{tipbox.jpg|TipBox.jpg}} **By default, the Ask method only sets the ****//equal //****to value; it does not set lower and upper values.** The generated filter expression searches for values greater than //lower//, less than //upper//, and equal to //equal//. For string fields, the GetFilter method applies the following special meanings to these special search characters: | **Symbol** | **Position** | **Filter Effect** | | ^ | prefix | caseless (case insensitive) search | | * | prefix | contains search | | * | suffix | begins with search | | //=// | prefix | inclusive search | | > | prefix | exclusive search--greater than | | <; | prefix | exclusive search--less than | For example: | **//lower//** | **//upper//** | **//equal//** | **query searches for** | | fred | | | values > fred | | | fred | | values <; fred | | | | fred | values = fred | | =fred | | | values >= fred | | | =fred | | values <;= fred | | | | >fred | values >= fred | | fred | fred | | values >= fred | | fred | george | george | values <;= george AND values > fred | | | | d* | values beginning with d (e.g., dog, david) | | | | *d | values containing d (e.g., dog, cod) | | | | ^d | values d and D | | | | ^d* | values beginning with d or D (e.g., dog, David) | | | | ^*d | values containing d or D (e.g., dog, cod, coD) | **Example:** **QueryClass.Ask       PROCEDURE(BYTE UseLast=1)** **I USHORT,AUTO** **EV CSTRING(1000),AUTO** **  CODE** **    SELF.Reset** **    LOOP I = 1 TO RECORDS(SELF.Fields)** **      GET(SELF.Fields,I)** **      EV = CLIP(EVALUATE(SELF.Fields.Name))** **      IF EV** **        SELF.SetLimit(SELF.Fields.Name,,,EV)** **      END** **    END** **    RETURN Level:Notify** **See Also:     **[[additem add field to query .htm|AddItem]], [[ask a virtual to accept query criteria .htm|Ask]], [[getfilter return filter expression .htm|GetFilter]], [[getlimit get searchvalues .htm|GetLimit]]