Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I check if the TAG exist?
Message
 
To
11/12/1997 15:09:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00065270
Message ID:
00065385
Views:
46
>>>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++.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform