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:
00510139
Vues:
21
Jay,

If tcVariable = "5" it should return C.
If tcVariable = 5 it should return N.

I have solved the problem. If tcVariable is type C, I check to see if its contents are a valid variable, field or property name.
lcType = TYPE( 'tuValue' )
IF lcType = 'C' AND ( LEFT( tuValue, 1 ) = "_" OR ISALPHA( tuValue ) ) AND TYPE( tuValue ) # 'U'
  lcType = TYPE( tuValue )
  tuValue = EVAL( tuValue )
ENDIF
>>Jay,
>
>>If tcVariable = "5" then the following code will set lcType to N instead of C. It appears that TYPE tries to evaluate uMyVar then returns the type of the result.
>
>>Shane
>
>Precisely. What do you want it to return in this case?
>
> Jay
Shane Murdoch
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform