[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function QUERY()
Action Interactive query by example condition builder
Returns <expC> macro expandable logical condition expression
Category Metafunction
Syntax expC = QUERY([ExpN],[array1],[array2])
Description A point and shoot condition builder. Complex
conditions are allowed with multiple .and./.or.
Called without parameters, all fields in the
current dbf are presented for condition building.
Options [ExpN],[array1],[array2] give field count, field
array and field description array. These, if passed
will be used in place of the default of all dbf
fields.
Examples
USE CUSTOMER
private flds[3],fdes[3]
flds[1] = "fname"
flds[2] = "lname"
flds[3] = "mi"
fdes[1] = "First Name"
fdes[2] = "Last Name"
fdes[3] = "Middle Initial"
qcond = "lastname > 'CCCC' "
filt = query(3,flds,fdes)
set filter to &filt
...
or
...
USE CUSTOMER
looker = query()
locate for &looker
Notes Makes variable 'QUERY_EXP' public. This contains the
current query expression, which is retained between
calls of query, and is looked for by other
SUPER functions.
Warnings Macro expanding the QUERY_EXP variable lengthens
the command line on which it is expanded. If the
command line goes beyond 254 characters, the
program will bomb. If this becomes a problem, create
a function called EVAL() or some such that you pass
QUERY_EXP to and it just does a return(&query_exp).
Then use it like so:
LOCATE FOR EVAL(m->query-exp)
Warnings Key -1 is unset on exit (F2)
Key -2 is unset on exit (F3)
Found in (prg)......S_QUERY.PRG
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson