Q

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Language Reference > Functions >

Q

The following topic discusses the Concordance Programming Language (CPL) functions that begin with the letter Q. For more information on CPL functions, see Functions, About the Advanced Programming Features, and About CPL Functions.

Query

int query(int db, number; char string[]);

Description - Retrieves and makes the selected query number the current query. The query is used by all functions until it is changed by a call to search(), select(), or query(). Queries manually changed in full screen functions, such as browse() and global(), are restored when the function returns.

oThe string parameter is optional. When it is supplied, the function will fill it with the search string used to create the query.

oTo use the entire database use query(db, 0). Query 0 is defined to contain every document in the database.

oTo clear all queries use query(db, -1). This will reset the query counter to 0, and erase the temporary query file.

Return Value - A -1 if the query is out of range, or if an error was encountered reading the query from disk.

See Also - Database information variables db.query and db.activequery.

 

QueryString

text queryString(int db, query);

Description - Retrieves the query logic string for the query. Unlike the query() function, it does not make the selected query number the current query.

Return Value - The text of the query or an empty string if either parameter is invalid or out of range.

See Also - query(), database information variables db.query and db.activequery.

Version - Version 7.30 and later.