Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local lnSomething as Integer
Message
From
15/06/2010 16:31:30
 
 
To
15/06/2010 14:41:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01469009
Message ID:
01469049
Views:
61
Koen --

Two things in particular about your message:

(1) Apparently, you can declare a datatype for a variable ("as Integer"), but VFP does not enforce this, as it can be re-assigned to be anything else. (In fact, it will always start as .F. regardless of the stated datatype). Is this correct?

(2) I understand how intellisense is used for objects, but not for this case, an Integer. Can you supply some sort of example where Intellisense would be available?

Thanks,

Jim


>>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
Jim Nelson
Newbury Park, CA
Previous
Reply
Map
View

Click here to load this message in the networking platform