This.oTags = createobject('Collection')The AddTag method adds information about an index to the collection:
lparameters tcName, ; tcExpr, ; tcFor, ; tcCollate, ; tlDescending, ; tlCandidate local loTag loTag = createobject('Empty') addproperty(loTag, 'Name', tcName) addproperty(loTag, 'Expression', tcExpr) addproperty(loTag, 'ForExpression', tcFor) addproperty(loTag, 'Collate', tcCollate) addproperty(loTag, 'Descending', tlDescending) addproperty(loTag, 'Candidate', tlCandidate) This.oTags.Add(loTag, tcName)Finally, the CreateTags method, called after the cursor has been filled, creates the defined tags:
local loTag, ; lcTag, ; lcExpr, ; lcFor, ; lcCollate, ; lcDirection, ; lcType for each loTag in This.oTags lcTag = loTag.Name lcExpr = loTag.Expression lcFor = iif(empty(loTag.ForExpression), '', ; 'for ' + loTag.ForExpression) lcCollate = iif(empty(loTag.Collate), '', ; 'collate ' + loTag.Collate) lcDirection = iif(loTag.Descending, 'descending', 'ascending') lcType = iif(loTag.Candidate, 'candidate', '') index on &lcExpr tag &lcTag &lcCollate &lcFor &lcDirection &lcType next loTagDoug