Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strict typing...
Message
 
 
À
14/11/2001 02:11:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00581332
Message ID:
00582106
Vues:
15
>Is it possible to force VFP to strictly type variables and properties...for instance I can do this:
>
>local xyz as number
>
>xyz=""
>
>and it retains the string. I have to say that I would rather it gave me an error, preferably at design time.

Paul,
While you can't do it with variables (as others have posted), you can do it with properties using an Assign method. In the Assign method, check the incoming assignment to see if it adheres to your data type. If it does, assign the new value. If not, disregard it or throw an error.

See VFP Help for more information on _Assign methods.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform