Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine column type by index tag
Message
 
 
To
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:
01682950
Views:
41
>>>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?

Hi Bill,
Thank you for answering my question. I hope you and the family are well.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform