[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|               TAG               |
+---------------------------------+
TAG([<.cdx  file>,] <expN1>
        [, <expN2> | <expC>])

-----------------------------------
Returns tag names from .CDX compound index files or names of .IDX index
files.
Return value - Character
-----------------------------------

TAG() returns tag names from open multiple-entry .CDX compound index
files and the names of open single-entry .IDX index files.  Tags are
index entries in .CDX compound index files created with the INDEX
command.

. Index files may be opened for a database with the INDEX clause of USE
or with SET INDEX.  A structural .CDX compound index file is
automatically opened with its database file.

<.cdx file>
        You may return tag names from a specific .CDX compound index file by
including the <.cdx file> name.

<expN1>
        The tag names in the .CDX compound index file are returned in the order
the tags are created.  For example, if <expN1> is 1, the name of first
tag created in the compound index file is returned.  If <expN1> is 2,
the name of the second tag created is returned and so on.  The null
string is returned when <expN1> exceeds the number of tag names.

        If you do not include a specific <.cdx file> name, TAG() returns .CDX
compound index file tag names and .IDX index file names in a specific
order.  First the names of .IDX index files are returned based on their
order in the INDEX clause of USE or SET INDEX.

        Tag names from the structural index file (if one exists for the
database) are then returned.  Tag names from other open .CDX compound
index files are then returned, again in the order the tags are created
in the .CDX compound index files and in the order the .CDX compound
index files are specified in the INDEX clause of USE or SET INDEX.

        The null string is returned when <expN1> exceeds the number of .IDX
index file names and tag names.

<expN2> | <expC>
        If the optional <expN2> or <expC> argument is not included, tag names
and .IDX file names are returned from the currently selected work area.

        You can return tag names from .CDX compound index files and .IDX file
names open in other work areas by including the work area number or the
alias of the database open in the work area.  You can include a work
area number in <expN2>, or a database alias in <expC>.

+---------------------------------+
|             Example             |
+---------------------------------+
CLOSE ALL
USE customer
DIMENSION dbftags(256)
dbftags(1) = 'Record #'
FOR i = 2 TO 256
        IF EMPTY(tag(i-1))
                i = i - 1
                DIMENSION dbftags(i)
                EXIT
        ELSE
                dbftags(i) = tag(i-1)
        ENDIF
ENDFOR
DISPLAY MEMORY LIKE dbftags

-----------------------------------

See Also:  CDX(), INDEX, MDX(), NDX(), SET INDEX, SYS(14) Index
expression, SYS(21) Master index number, SYS(22) Master tag/index name,
SYS(2021) Filtered index expr, USE

-----------------------------------

See Also: CDX() INDEX MDX() NDX() SET INDEX SYS(14) Index
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson