Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check the type of a parameter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00508539
Message ID:
00508846
Vues:
22
Kurt,

This does not work if uMyVar contains the name of a variable that contains a numeric value. If uMyVar equals "3", ".T." or "{^2001/01/01}" then TYPE("&uMyVar") or TYPE(uMyVar) returns N, L or D instead of U. This is the problem that I have. It appears that TYPE tries to evaluate uMyVar then returns the type of the result.

Any ideas,

Shane

>Here you go....
>
>The only drawback to this is that the parameters passed cannot be declared as local in the calling procedure
>
>PROCEDURE cMyFunc( uMyVar )
>
>IF TYPE('uMyVar') = 'C' AND NOT INLIST(TYPE(uMyVar),'U','N')
> cReturnValue = TYPE(uMyVar)
>ELSE
> cReturnValue = TYPE('uMyVar')
>ENDIF
>RETURN cReturnValue
>ENDPROC
>
>
>Kurt
Shane Murdoch
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform