Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'm.'-prefix. How? What? Why?
Message
From
21/10/2002 08:19:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00713445
Message ID:
00713446
Views:
24
>Hi,
>
>When using the scatter command on a table, an object variable is created (m) with the column names as properties. (ie, m.id)
>
>But, when declaring a variabel with
>LOCAL a
>it can also be accessed with m.a.
>Same with creating objects.
>
>LOCAL o
>o = CREATEOBJECT( "CUSTOM" )
>
>m.o.DESTROY()
>
>What's up with the m.? Why is it there? (Why) should I use it?

If you have a field name called "abc" and a memory variable called "abc", a command like:
abc = 1 + 2
will store the value into the variable. BUT if you try to access the variable:
? abc

* or:

def = abc
The field will take precedence. This is solved with the "m." prefix:
? m.abc && will show the variable, not the field.
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform