Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>In my case, and keep in mind that is just my personal preference I am not saying your code is useless, I try never to use a generic function to get a particular result when there is a function which has been written specifically to address that particular need, in this case the Field() function specifically addresses the original poster question so I would use it even if Type returned the correct result always, which is not the case by the way, there is a thread somewhere but I think the gist of it is something like this (I think there are better examples in the aforementioned thread)
I'd like to agree with that but, it's never that simple. Field didn't always accept the field name. Hence the use of type etc. In fact the sample code for FIELD() even now does not show that it accepts anything but a number. ;) A UDF is supposed to encapsulte the complexities. An IsField UDF does the job while allowing our code to improve while never needing to go back and replace all TYPE() with FIELD().
Further, the penchant to write a formula off the cuff yields code that is unreable. Even the formula "TYPE('something')" cannot be deciphered as easily as "IsField('something')".
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only