O

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Language Reference > Functions >

O

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

OnExit

int onexit(text exitFunction);

Description - Runs a Concordance menu command after the CPL program terminates. The exitFunction parameter is a string containing any standard item that appears in the Concordance menus, such as "Browse" or "Table." Use an empty string, "", to reset the onexit() function.

Return Value - A nonzero value if successful, zero if onexit() has been reset. The function is reset and zero is returned if the exitFunction menu string was not matched.

Version - Version 8.0 and later.

 

Open

int open(char string[], type[]);

Description - Opens a file for use and returns that file's handle. The handle must be used to access the file.

Type can be:

"ru" or "rU" Open existing Unicode file for read only access.

"wu" or "wU" Create empty Unicode file for writing, erases file if it exists.

"au" or "aU" Open or create Unicode file for appending, no reading.

"ru+" or "rU+" Open existing Unicode file for reading and writing.

"au+" or "aU+" Open or create Unicode file for appending and reading.

"wu+" or "wU+" Open Unicode file for reading and writing.  This erases the file if it exists.

oUse caution with "w+" and "w" as they will reset a file and destroy its contents if the file already exists.

Note that both parameters must be either text or char arrays, they can not be character literals as in 'r'. Always use quotes to enclose the parameters, never use apostrophes.

Return Value - A file handle if successful, -1 if not successful.

See Also - read(), write(), readln(), writeln(), close(), exist(), erase()

 

OpenDB

int opendb(char string[]);

Description - Opens the database and returns a file handle which must be used to access the database documents, its fields, and statistics. The first document in the database is automatically read into memory by the opendb() command.

Return Value - A -1 indicates an error opening the database. Any other positive value is a database handle. Up to 16 databases may be open at one time, if available memory.

See Also - closedb()

 

OpenDBConvert

int opendbconvert(text database path);

Description - Converts version 8 or 9 databases to Concordance version 10. Opens the database and returns a file handle to the database, which must be used to access the database documents, its fields, and statistics. The first document in the database is automatically read into memory by the opendb() command.

The opendbconvert function does not validate or prompt for administrator username and password credentials. To prevent databases from inadvertently being converted to version 10, please ensure that you have only chosen directories and file paths to databases you wish to convert to version 10.

Return Value - A -1 indicates an error opening the database. Any other positive value is a database handle. Up to 16 databases may be open at one time, if available memory.

See Also - closedb()

 

Operator

operator("ADJ");

Description - Sets the default operator recognized by search(). The operator can be any valid search operator: ADJ, ADJ1 - ADJ99, NEAR, NEAR1 - NEAR99, OR, AND, NOT, XOR.

Return Value - None.

 

OverlayFS

overlayfs(int db);

Description - Invokes Concordance full screen Overlay mode. The screen is automatically saved before entering Overlay and restored after exiting.

Return Value - None.