Programmer Guide/Command Reference/QUERY: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 12: Line 12:
;<var>field</var>: the table field to search.
;<var>field</var>: the table field to search.
;<var>querystring</var>: the string to search for.
;<var>querystring</var>: the string to search for.
;<var>cexpr</var>, <var>copr</var> <var>cexpr</var>: see <code>[[Programmer_Guide/Shell_Items/Table/SET_TABLE#FINDEXPR|SET table FIND]]</code>.
;<var>cexpr</var>, <var>copr</var> <var>cexpr</var>: {{:Programmer_Guide/General_Descriptions/Find_Expressions}}
;<code>/i</code>: The search will be case insensitive (by default, it is case sensitive).
;<code>/i</code>: The search will be case insensitive (by default, it is case sensitive).
;<code>/t</code>: only tagged table entries will be considered.
;<code>/t</code>: only tagged table entries will be considered.

Revision as of 14:42, 28 April 2014

The QUERY command, although similar to the FIND command, offers the programmer more choice in how to search.

QUERY [ /i ] [ /t ] [ /m=matchtype ] /- table startentry field querystring
QUERY /m=find table startentry cepr [ copr cexpr ... ] [ /t ] // works like SET table FIND
matchtype
one of the keywords regular, wildcard, substring, full, and find.
table
the table to search.
startentry
the zero-based index of the entry at with which to start the search.
field
the table field to search.
querystring
the string to search for.
cexpr, copr cexpr
cexpr Description
fieldid:cond
fieldid name or index of a defined field
cond = (is assigned), ! (is not assigned)


fieldid:cond:value
fieldid name or index of a numerical field (0 for simple tables)
cond <, <=, ==, !=, >= or >
value a number or numerical expression, or a string.


fieldid:cond:mask
fieldid name or index of a string field (0 for simple tables)
cond =I match, ignoring case
!I do not match, ignoring case
=R match, respecting case
!R do not match, respecting case
mask match string, may contain wildcard characters. if field is of type name, mask must be a valid name
/i
The search will be case insensitive (by default, it is case sensitive).
/t
only tagged table entries will be considered.
/m=regular
querystring will be considered a POSIX regular expression.
/m=wildcard
querystring will be considered an STx wildcard expression (just like FIND).
/m=substring
All characters in querystring will be considered autonomous, i.e. naming themselves. The FIND command will find the first entry of which querystring is a substring.
/m=full
All characters in querystring will be considered autonomous, i.e. naming themselves. The FIND command will find the first entry whose content is exactly identical to querystring (with the possible exception of case).
/-
You should always use the /- "non-option" option before the first argument in order not to cause arguments to be mistaken for options.

Navigation menu

Personal tools