Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local lnSomething as Integer
Message
From
15/06/2010 14:41:15
 
 
To
15/06/2010 14:12:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01469009
Message ID:
01469016
Views:
67
>I have seen references in code that look like this:
Local lnSomething as Integer
>Obviously this tells me that {lnSomething} is an integer, but I knew that because it begins with ln,
>
>So, what is the purpose in doing so? Does VFP use this information in some way?
>
>P.S.: I do understand the use of this structure when it refers to 'as Form', or whatever, just not when it refers to a datatype like String or Integer.
Hi,

to make use of abbrevations like ln for local - numeric and ln for local - integer or crsData as cursor Data is to my opinion only a very usefull method for the programmer. Easy to understand, for VFP is is of no use what so ever.
In case you extend your local declarations with local lnSomething as integer this is only again for the programmer and not for VFP, also it makes you show the intellisense.
Please remember that although you have started your declarations to a certain type you are free to change it on the fly.
So local llSomething as integer
llSomething = "myVariable"
will give you no error
even worse, you face no error when you continue to
llSomething = 12
or what ever

Some people just like this behavior of VFP others get sick of this.
Moral, always be very carefull with your declarations and always be very strict to make use of common abbrevations, I am not in favor of lxSomething but that maybe a personal flavor.

Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform