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

Click here to load this message in the networking platform