Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- Index for a field
Message
From
23/06/1999 17:32:55
 
 
To
23/06/1999 09:48:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00232706
Message ID:
00233232
Views:
31
>Any suggestions about the index expression NOT matching the field situation?
>

Rather than ==, you could try using $ (substring find) but you'll need to take some care in constructing queries if you have a complex expression, since Rushmore requires an exat match on the index expression for it to be used. You could also check using =, so that if the field were the first part of a complex expression, it'd match.

You might want to modify the code to find all the pssoble matches if an exact match isn't the only thing considered; there could be >1 index tag that matches up with a less restrictive match criterion. You might also want to exclude filtered indexes (index containing a FOR clause) from consideration. You can check for a filter on an index using SYS(2021).

>
>>>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.
>>>
>>
>>The easiest way would be to spin through the atgs and examine the index expression using SYS(14):
>>
>>
USE <i>JRandomTable</i>
>>LOCAL nCtr, nTagCount
>>nTagCount = TAGCOUNT()
>>FOR nCtr = 1 TO nTagCount
>>   IF UPPER(SYS(14,nCtr)) == 'REPNUM'
>>      EXIT
>>   ENDIF
>>ENDFOR
>>*  If nCtr <= nTagCount, there's a tag, and it's number is nCtr
>>*  You can now get the name of the Tag with TAG(nCtr)
>>*  This won't work unless the index expression matches the field with
>>*  no functions or extended expressions;  if this were a character
>>*  field and a tag with that field was used as a part of a concatenated
>>*  key, or you used the UPPER() function, it won't match
>>
>>>Thank you in advance.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform