Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I check if the TAG exist?
Message
 
À
11/12/1997 15:09:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00065270
Message ID:
00065385
Vues:
43
>>>I want to call...
>>>set order to tag sorttemp...
>>>I will not know if there is a sorttemp out there.
>>>How do I check if the TAG exist?
>>
>>Robert,
>> Try this...
>>
>>FOR nCount = 1 TO 254
>>
>> IF !EMPTY(TAG(nCount)) && Checks for tags in the index
>>
>> IF UPPER(TAG(nCount)) = 'THISTAG'
>>
>> WAIT 'TAG Found!!'
>>
>> ENDIF
>>
>> ELSE
>>
>> EXIT && Exit the loop when no more tags are found
>>
>> ENDIF
>>
>>ENDFOR
>>
>>Thanx!
>>
>>Tony Miller
>>Vancouver, Wa
>
>Works Tony - thanks... : ))))))

Another solution (and probably faster) is to trap errors and attempt to set the order to mytag. If this operation fails then your own error handling routine can record the error, respond, etc.
x = on('error')
on error lnErr = error()
lnErr = 0
set order to tag (y)
on error &x.
if lnErr != 0
    ** Do Error action
endif
I used this for dynamic indexing. If setting the order failed, I indexed the column on the spot.
HTH,
Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform