Click or drag to resize

Tag Function

X#
Returns a tag name from an open compound index (.cdx) file or the name of an open single-entry (.idx) index file.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION Tag(
	CDXFileName,
	nTagNumber,
	uArea
) AS STRING CLIPPER
Request Example View Source

Parameters

CDXFileName (Optional)
Type: Usual
Specifies the name of the .cdx file to return a tag name from.
nTagNumber (Optional)
Type: Usual
Specifies a number corresponding to the order in which a tag was created in the compound index file. For example, if nTagNumber is 1, TAG( ) returns the name of the first tag created in the compound index file. If nTagNumber is 2, TAG( ) returns the name of the second tag created, and so on. TAG( ) returns the empty string when nTagNumber exceeds the number of tag names. If you omit CDXFileName, TAG( ) returns compound index file tag names and single-entry index file names in a specific order as follows: Names of single-entry index files are returned based on their order in the Index clause of Use or Set Index. For more information, see Use Command and Set Index Command. Tag names from the structural compound index file (if one exists for the table) are returned. Tag names from other open compound index files are returned, again in the order in which the tags were created in the compound index files and in the order in which the compound index files are specified in the Index clause for Use or Set Index. Returns tag names and index file names from files open in another work area. nWorkArea specifies a work area number and cTableAlias specifies a table alias. By default, tag names and index file names are returned from files in the current work area.
uArea (Optional)
Type: Usual

Return Value

Type: String
Character. TAG( ) returns an index tag name as an uppercase character string.
Remarks
Tags are index entries in compound index (.cdx) files created with the Index command. Single-entry index (.idx) files contain only one entry; therefore, TAG( ) returns the file name for .idx files. A structural compound index (.cdx) file opens with its table automatically. You can open non-structural .cdx files and .idx index files for a table using the Index clause in the Use command or using the Set Index command.
Examples
X#
1Close Databases
2Open Database (HOME(2) + 'Data\TestData')
3Use Customer
4Clear
5For nCount = 1 TO TAGCOUNT()
6? TAG(CDX(1),nCount)
7ENDFor
See Also