Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining if an index tag already exist in a CDX
Message
From
09/10/1998 18:44:52
 
 
To
09/10/1998 18:20:27
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00145580
Message ID:
00145581
Views:
22
>Is there a way to programmatically determine whether an index tag for a table exists?
>
>I've got an app in production and we have an upgrade to the software, on that requires an existing table have an additional index added to it -- a regular index.
>
>I have a startup routine that already checks to make sure needed tables are where they should be so I was thinking of modifying the startup routine so it checks to see if the index tag for the table in question already exists in the table's CDX. If not, then I'll create it programmatically, otherwise, do nothing. I can't find a FoxPro function that already does something like that.
>
>Any or suggestions ideas?

Try:
FUNCTION TagExists
LPARAMETERS cTagToFind, cAlias, cCDXFile
LOCAL lResult, nTagNo, cTag
cTagToFind = UPPER(cTagToFind)
lResult = .F.
nTagNo = 1
cTag = TAG(cCDXFile, nTagNo, cAlias)
DO WHILE ! EMPTY(cTag)
    IF cTagToFind == UPPER(cTag)
        lResult = .T.
        EXIT
    ELSE
        nTagNo = nTagNo + 1
        cTag = TAG(cCDXFile, nTagNo, cAlias)
    ENDIF
ENDDO
RETURN lResult
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