<< Click to Display Table of Contents >> Navigation: Concordance Programming Language Reference > Functions > K |
The following topic discusses the Concordance Programming Language (CPL) functions that begin with the letter K. For more information on CPL functions, see Functions, About the Advanced Programming Features, and About CPL Functions.
int keep(int db; text filename); |
•Description - Saves all queries in the current session to the named file. Concord ance normally appends the file extension . QRY to saved query files. The keep() function does change the file name passed to it.
•Return Value - Returns a nonzero value if an error was encountered while saving the queries. An error return indicates a bad file name, or a full disk.
•See Also - exec(), snapshot()
int keypress(); |
•Description - Checks to see if there is a key in the input buffer. keypress does not read the key from the buffer if one is ready. It immediately returns to the caller, whether or not a key is ready.
•Return Value - Returns a zero if no key is ready, otherwise it returns the value of the key that will be returned by the next getkey() call.
•See Also - getkey()
Example
main() { int ESC, finished; ESC = 27; finished = 0; /* Loop until finished or until */ /* someone hits the ESC key. */ while((keypress() <> ESC) and (finished == 0)) finished = DoSomething(); /* If the user hit the ESC key */ /* to terminate processing early, */ /* read it from the buffer. */ if (keypress() == ESC) getkey(); } |