Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strict typing...
Message
 
 
To
14/11/2001 02:11:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00581332
Message ID:
00582106
Views:
14
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform