Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local lnSomething as Integer
Message
 
À
15/06/2010 14:12:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01469009
Message ID:
01469035
Vues:
63
>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.


I like to use it as a basic in-line documentation, for example, to use your sample, for me is not 100% clear that ln is for Integers, as I use it for numbers, but in the declaration I would use
local lnIterator as Integer, lnValue as Decimal(10, 4) && For example if I am mapping the value to a table
Also there are some types that not everyone agrees to it's prefix, for example variant, some use lv, others lx etc. where local lxTest as Variant would clarify the issue
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform