Hi!
For me it appears as a defect. The most stranmge is that built-in VFP functions are accepted by type() function correctly, for example:
? TYPE("alltrim('00023')")
returns correct value "C".
Well, I see you found a solution alredy < s >. BTW, you can mark your own message as answer to the thread :-)
>Hi everybody,
>
>I have a class called Global Editor. This class allows to make replacements of different kind: Field with value, Field with content of another field, swap fields, delete group of records.
>
>If the user chooses the second option, I check, that field type and replacement field (or combination of fields) are the same type using type function.
>
>Unfortunately, as I just found, type doesn't return correct results, if UDF is used, e.g.
>type("trimzero('00034')") returns U, while vartype(trimzero('00034')) returns C (trimzero is custom function, which removes leading 0s).
>
>So, what would you suggest me to do? I didn't want to use vartype, because it may throw an error, if the expression is incorrect...
>
>Thanks in advance.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.