QMOpen() |
|
|
The QMOpen() function opens a file. It is analogous to the QMBasic OPEN statement.
Format
where
The QMOpen() function opens a QM database file. The returned integer value is the file number which must be used in all subsequent operations against this file. If the file cannot be opened, the function returns zero. The QMStatus() function can be used to retrieve the error cause.
To open a dictionary, the FileName argument should commence with "DICT" and a single space separating this prefix from the file name, for example:
DictNo = QMOpen("DICT READERS")
There is no practical limit to the number of files that can be open at one time.
Examples
The above program fragment opens the CLIENTS file, reads the record identified by ClientNo, and then closes the file. A real program should test the ErrNo status from the read to determine if the action was successful.
Note that the C example leaves variables Rec pointing to a dynamically allocated memory area that must be released using QMFree() when no longer needed. |