Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is m. prefix?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01198197
Message ID:
01198316
Vues:
6
Well stated Dan!


>The other guys told you the mechanics, but you asked what it *is*.
>
>It's a scope indicator.
>
>If you have a customer.dbf open you can reference the name field with customer.name. The "customer." is the scope. You're telling the engine that you don't mean any other "name" value but the one in the customer alias.
>
>Likewise, if you
>
> Use Customer Alias Deadbeats
> ? Deadbeats.Name
>
>You're scoping the value you want from name.
>
>The letters A-J are reserved for the first 10 workareas, only for backwards compatibility to dBaseIII. The letter m is reserved for memory variables.
>
>So m.Whatever specifically tells Foxpro you want the value of the memory variable Whatever instead of any other field that might have that same name.
>
>People will tell you not to use single-letter variable names for objects, but only because they don't understand the scope. This will fail:
>
> a = Createobject("Form")
> a.Show()
>
>VFP will default to looking for the Show field in the first workarea.
>
>But this works fine:
>
> m.a.Show()
>
>because it is properly scoped, and all ambiguous defaults and assumptions are removed.
>
>Scope is an important part of the language and it can be VERY subtle.
>
>Dan
>
>
>>Hi,
>>
>>Excuse my ignorance, but I've been constantly encountering code in UT with a variable preceded with an ".m", like below:
>>
>>
>>ldFrom = MIN(m.tdFrom,m.tdTo)
>>
>>
>>What is ".m" ?
>>
>>Thanks in advance.
>>
>>Steve
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform