Sorry you had to get bitten to learn it. There are those who will argue naming conventions will stop this, but I can't always control the field names users will come up with. So the only way I can be sure my code will not crash is to use mdot.
http://fox.wikis.com/wc.dll?Wiki~EssentialMDotI now put m. in front of every memory variable I can.
>If you run the little code snippet below it will not give you the results you expect. However, in proc secprg if you change x and y to m.x and m.y, you will get the desire results. This VFP behavior just bit me in the *** big time when I added a field to a table in an application and was dismayed to be alerted by uses that a part of my program which had worked flawlessly for years suddenly was broken.
>
>Clear
>Create Table test Free (x n(1),y n(1))
>Use test
>Append blank
>Replace x With 3
>Replace y With 5
>?x
>?y
>Do secprg
>?x
>?y
>Use In test
>Delete File test.dbf
>
>****************
>Procedure secprg
>local x,y
>x='a'
>y='b'
>?x
>?y