User Tools

Site Tools


setlimit_set_search_values_.htm
Navigation:  ABC Library Reference > QueryClass > QueryClass Methods >====== SetLimit (set search values) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetLimit( name [ ,lower ] [ ,upper ] [ ,equal ] )

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

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, Ask, GetFilter, GetLimit

setlimit_set_search_values_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1