Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- Index for a field
Message
From
22/06/1999 18:58:48
 
 
To
22/06/1999 16:21:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00232706
Message ID:
00232769
Views:
18
>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
Next
Reply
Map
View

Click here to load this message in the networking platform