No. But this will work. (untested code, but the logic is good)
repnum_keyno = 0
for x = 1 to tagcount()
if "REPNUM" $ upper(key(x)) then
repnum_keyno = x
exit
endif
next
if repnum_keyno > 0 then
set order to (tag(repnum_keyno))
else
index on repnum tag repnum
endif
>I already tried something like that. Any other thoughts? Thank you again.
>
>
>>There doesn't seem to be an easy answer. You have to use something like the tag() function to step thru all your indexes and check to see if the field is part of the key() of the index.
>>
>>
>>>How do I check if a field has an index?
>>>
>>>I would like to know if my REPNUM field has an index but I can't find a way of doing this.
>>>
>>>I have been trying TAG(), TAGNO(), TAGCOUNT(), CDX() and other functions but no answer yet.
>>>
>>>Thank you in advance.
--Todd Sherman
-Wake Up! Smell the Coffee!