Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Type function is not smart enough
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Type function is not smart enough
Miscellaneous
Thread ID:
00714883
Message ID:
00714883
Views:
56
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.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform