Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Type function is not smart enough
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Type function is not smart enough
Divers
Thread ID:
00714883
Message ID:
00714883
Vues:
57
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform