Command SET INDEX Foundation
Opens one or more index files in the current work area.
SET INDEX TO [<cIndexFiles,...>] ;
[ORDER [TAG] <nIndex> | <cTagName>
[ASCENDING | descending]
[ADDITIVE]
The command SET INDEX opens a list of index files in the current work area. If index files are already open in the work area, they are first closed. The first index file in the list <cIndexFiles,...>determines the controlling index and the record pointer is positioned to the first logical record of this controlling index.
Opening index files logically sorts the records of the database open in the work area in the order specified by the controlling index.
If index files are already opened in the current work area and more indexes are to be opened without closing the existing ones, the function DbSetIndex() or the function OrdListAdd() should be used. The controlling index is defined using the command SET ORDER.
The command SET INDEX is often used in multi-user applications instead of the INDEX option of the USE command. This allows the database to be first opened with USE, and the applicable index files are opened only if the database is successfully opened.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.