>I have a grid populated with a cursor from a SQL statement. After the cursor is created, I create indexes ASC and DESC to be used in the header click event. All works well except when the index is longer than 10 characters. I am using a for loop to loop through the fields of the cursor and create corresponding ASC and DESC indexes using the name of the field, which is some cases, is longer than 10 characters...this is my problem. Does anyone have any ideas/techniques to shorten the length of the tag names so I can be sure that they aren't longer than 10 characters? Any ideas appreciated!!!
>
>Thanks
>
>John.
John,
You could do something like this.
dimension aTags[fcount(),2]
for ix=1 to fcount()
aTags[ix,1] = field(ix)
aTags[ix,2] = "TAG"+padl(ix,3,"0")
index on &aTags[ix,1] tag (aTags[ix,2])
endfor
for ix=1 to fcount()
if lower(this.parent.controlsource) == ;
lower(this.parent.parent.recordsource+"."+field(ix))
cTagName = aTags[ix,2]
exit
endif
endfor
set order to tag (cTagName)
Cetin