Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is m. prefix?
Message
From
23/02/2007 12:33:41
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01198197
Message ID:
01198375
Views:
6
Wow, great explanation Dan! :o)


>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform