[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
COMPACT
COMPACT creates a compact .IDX file.
ASCENDING | DESCENDING
CDX tags can be built in ascending or descending order. By default,
CDX tags are created in ascending order (you may include ASCENDING as a
reminder of the index file's order). A database may be indexed in
reverse order by including DESCENDING.
DESCENDING may not be included when creating .IDX index files. You
may, however, specify a descending order for a .IDX index file with SET
INDEX and SET ORDER.
UNIQUE
UNIQUE specifies that only the first record encountered with a
particular index key value will be included in an .IDX file or .CDX tag.
UNIQUE can be used to prevent the display or access of duplicate
records. All records added with duplicate index keys are excluded from
the index file. Using the UNIQUE option of INDEX is identical to
executing SET UNIQUE ON before issuing INDEX or REINDEX.
ADDITIVE
When you create an index file or files for a database with INDEX, any
previously opened index files (except the structural index) are closed.
If the ADDITIVE keyword is included, previously opened index files
remain open.
Warnings
--------
Although not recommended, <expr> can also be a memory variable, array
element, or a field or field expression from a database in another work
area. Memo fields cannot be used alone in index file expressions; they
must be combined with other character expressions. If you access an
index that contains a variable or field that no longer exists or cannot
be located, the error message "Variable not found" is displayed.
A system message "Warning: Index expression contains aliased fields" is
displayed if a field you include in the index expression is prefaced by
a database alias or work area letter. FoxPro's Rushmore technology
optimizes performance through use of indexes, and cannot use indexes
created with aliased fields. For best performance, avoid using aliased
fields when creating index files. Refer to the Rushmore discussion in
the FoxPro Developer's Guide for additional information.
If you attempt to build an index with a key that varies in length, the
key will be padded with spaces. Variable length index keys are not
supported in FoxPro.
+---------------------------------+
| Examples |
+---------------------------------+
***** Index on one field
CLOSE ALL
USE customer
INDEX ON company TO complist
***** Index on more than one field
CLOSE ALL
USE customer
INDEX ON SUBSTR(city,1,5) + SUBSTR(company,1,6) TO citycomp
***** Filtered index
CLOSE ALL
USE payments
INDEX ON date FOR amount > 500 TO bigbalnc
***** Index with tags
CLOSE ALL
USE customer
INDEX ON address1 TAG address1
INDEX ON company TAG company OF custcdx
INDEX ON taxrate TAG taxrate OF custcdx DESCENDING
-----------------------------------
See Also: COPY INDEXES, COPY TAG, REINDEX, SET INDEX, SET ODOMETER, SET
ORDER, SET TALK, SET UNIQUE, SORT, SYS(14) Index expression, SYS(2021)
Filtered index expr, USE
-----------------------------------
See Also:
COPY INDEXES
COPY TAG
REINDEX
SET INDEX
SET ODOMETER
SET
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson