table.INDEX_TAG_ADD Function


as P = Index_Tag_Add(C Tagname,C Order_expression[,C Filter_expression[,C Index_Type]])



The name of an existing index or new index that should be created. Any character string, up to 10 characters long, used to identify the index.


A character order expression that sorts selected records.


Optional. Default = all records. A character filter expression that selects the records to be indexed.


Optional. Default = "" (Ascending, not unique). A string of character flags that can specify a descending sort order (?D'), and or include only records with unique key values (?U').


Add a tag to the production index for the database.


The .INDEX_TAG_ADD() method finds an existing index, specified by Tag_Name, in the production index file for a table. If the index does not exist, the method creates it. When called, this function first searches the index file to see if this index already exists. If an index with identical specifications (i.e., the same Order_Expression, Filter_Expression, and Index_Type ) is found, .INDEX_TAG_ADD()returns an object pointer to this index. If the index does not already exist, .INDEX_TAG_ADD()creates the new index tag and adds it to the production index file. It returns an object pointer, , to the new index tag. If no index tags have been previously created for , a new production index file is created. The production index is the index file with the same name as the table name (with a .CDX extension). It is opened automatically when the table is opened.


Add a descending index on the FIRST_NAME field.

dim tbl as P
tbl = table.current()
indx = tbl.index_tag_add("BYNAME", "FIRST_NAME", "", "D")

See Also