store is already faster than lcVariable = '', also it's impossible to Store into a field of a table, therefore m. is not necessary, on the other side it's not hurting. In a number of experiments with 10 million loops I get no tendency towords the one or the other being faster or slower, even with a table open in the current work area having 255 fields. MDots is only making a difference when you read from a variable, not store to it, not with STORE TO nor with =.
I agree with Olaf that you wouldn't expect a performance difference when using STORE. However, it might be a different story if the variable is to the right of an equals sign, such as x = m.y.
Several people have done performance tests on this (sorry I don't have any references to hand). In older versions of VFP (and 2.x), it was sometimes faster to include the "m." and sometimes not, depending in part on whether any table was open in the current work area. In more recent versions, using "m." seems to be consistently faster (but perhaps not enough to actually make a noticeable difference to your application).
Personally, I never use "m." where it's syntactically meaningless, such as to the left of an equals sign (m.x = 1) or in the STORE command. But I guess it does no harm.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
you're right. And m. can make a huge difference if you have a table with many fields open in a current work area and read some variable without m.
As VFP is a datacentric application it prefers fields of tables, and as you can adress a field of a table in the current workarea with the pure filedname field instead of alias.field that makes a difference. With m. you not only tell VFP it shouldn't care searching for a field of the same name, you also simply make sure it adresses the variable and not a field.
There was a rather huge discussion some weeks ago at Foxite about useing mdot.
It's not meaningless also for the safety of your code, still I don't apply this "rule". I layed out my arguemnts there, you'll surely find it in the Foxite archives.
I'm rather after some projecthook automagically adding mdots where needed. It's not that hard to do. You might even act upon save of a method or prg.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.