Difference between revisions of "Programmer Guide/Command Reference/QUERY"

From STX Wiki
Jump to navigation Jump to search
Line 13: Line 13:
 
;<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#FIND|SET table FIND]]</code>.
 
;<var>cexpr</var>, <var>copr</var> <var>cexpr</var>: see <code>[[Programmer_Guide/Shell_Items/Table/SET_TABLE#FIND|SET table FIND]]</code>.
;<var>/i</var>: 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).
;<var>/t</var>: only tagged table entries will be considered.
+
;<code>/t</code>: only tagged table entries will be considered.
;<var>/m=regular</var>
+
;<code>/m=regular</code>
 
:<var>querystring</var> will be considered a POSIX regular expression.
 
:<var>querystring</var> will be considered a POSIX regular expression.
;<var>/m=wildcard</var>
+
;<code>/m=wildcard</code>
 
:<var>querystring</var> will be considered an {{STX}} wildcard expression (just like <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code>).
 
:<var>querystring</var> will be considered an {{STX}} wildcard expression (just like <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code>).
;<var>/m=substring</var>: All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry of which <var>querystring</var> is a substring.
+
;<code>/m=substring</code>: All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry of which <var>querystring</var> is a substring.
;<var>/m=full</var>:All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry whose content is exactly identical to <var>querystring</var> (with the possible exception of case).
+
;<code>/m=full</code>:All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry whose content is exactly identical to <var>querystring</var> (with the possible exception of case).
;<var>[[Programmer_Guide/Command_Reference_Options/-|/-]]</var>: You should always use the [[Programmer_Guide/Command_Reference_Options/-|/-]] "non-option" option before the first argument in order not to cause arguments to be mistaken for options.
+
;<code>[[Programmer_Guide/Command_Reference_Options/-|/-]]</code>: You should always use the [[Programmer_Guide/Command_Reference_Options/-|/-]] "non-option" option before the first argument in order not to cause arguments to be mistaken for options.

Revision as of 15:34, 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
see SET table FIND.
/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.