Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local scoop wish
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00720623
Message ID:
00721084
Views:
11
You can see VFP weak typing as a bad thing but sometimes i use it and it can be really usefull:
Function DoSomeThing( vParm )

	DO CASE
		Case Vartype(vParm) == "O"
			*-- Do someting
		Case Vartype(vParm) == "N"
			*-- Do someting else
		*...
	EndCase

EndFunc
This pretty much simulate method overloading ! Thank to VFP weak typing.

>It is not a bad practice, I agree. The other bad thing in VFP is that there is nothing that prevent you from doing this:
>
>
x = 1
>x = 'A'
You couldn't do this in C#.
>
>>There is a very thin line between declaring and assigning a value to a variable.
>>
>>In VFP
>
>>x = 1 && Declare and assing x to 1 (declared as private)
>
>>IN C#
>
>>int x = 1; // Declare and assing x to 1 (declared as local)
>
>>what is different ? both language can declare and assign on the same statement, is it bad practice ? IMHO it is not, the bad thing is that x is declared private in VFP.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform