table.INDEX_NAME_GET Function

Syntax

Tag_Name as C = Index_Name_Get([N index])

Arguments

index

Optional. Default = All. The number of the tag name that you wish to retrieve.

Description

Retrieve open index tag names (from 1 to n) - if parameter ommitted, report ALL names.

Discussion

The .INDEX_NAME_GET() method returns the tag name of the N th index tag in the production index for the table referenced by the object pointer, . If Number is not specified, Alpha Anywhere returns a CR-LF delimited list of indexes.

Example 

This script displays a list of tags in the current table.

dim tbl as P
dim index[20] as C
tbl = table.current()
i = 1
count = 1
while tbl.index_name_get(i) <> ""
    'Get name of index tag
    tag = tbl.index_name_get(i)
    'Get pointer to tag
    ip = tbl.index_get(tag)
    'Find out if it is an index or a query
    type = ip.type_get()
    'If an index ...
    if type = 2 then
       index[count] = tag
       count = count + 1
    end if
    i = i + 1
end while
tag_select = ui_get_list_array("Choose an index tag", 1, "index")
tbl.index_primary_put(tag_select)

The following script creates an array using a different technique.

dim tbl as P
tbl = table.current()
indexes = tbl.index_name_get() 'because no parameter is used
             'Alpha Anywhere returns a CR-LF list
count = w_count(indexes,CRLF())
dim index_array[count] as C
index_array.initialize(indexes)

See Also