Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine column type by index tag
Message
From
08/12/2021 21:54:26
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01682939
Message ID:
01682945
Views:
39
>>Hi,
>>
>>I can determine the name of the currently selected index tag (using tag()). And I need to determine the type of field this index tag is built on. For example,
>>Index tag name can be "COST_CENT" but the type of field could be a character or a numeric. Is there a way to determine?
>>
>>TIA
>
>In addition to the method suggested by Tore,
TYPE(SYS(14,TAGNO(TAG())))
, which works, I found another way to determine the type. Using
>
>VARTYPE(EVALUATE(KEY()))
>
>
>Both approaches work. If anybody thinks that one approach is more reliable than the other, please let me know. The speed is not that important.
>
>TIA

Hi Dmitry
Hope all is well.
Why use VARTYPE rather than TYPE?
Here's one answer.
I'm one of those privileged to put MCP after my name. The crowd in Commack, Long Island who administered the test gave a big "Yeah Bill!!!" after they scored it and told me that I was probably the oldest owner of that certification.
With the passage of time, I probably am.
At that point I had been programming VFP full time for more than 10 years.
One of the questions on the exam how to use VARTYPE.
Fortunately I had read the manual and answered it correctly and that contributed to my passing the exam.
That said, I can positively state that I have never used that command, ever.
I have no idea why it was created.
I'm sure that there's some microscopic reason why one is preferable to the other but do we really care?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform