Apostasy seems a little strong, Gene... :-)

According to the help file, "Whenever possible, use EVALUATE( ) or a name expression to replace macro substitution using the & Command. EVALUATE and name expressions execute faster than macro substitution."

Macro expansion is incredibly useful, of course, and used to be the only way to accomplish a lot of things of this ilk. Name expressions and EVALUATE() came along and obviated the need to use macro expansion for many of those things but not all of them. If you have some kind of loop with a macro inside of it, the EVAL or name epxression can be significantly faster over the lifetime of the loop.

I think the explanation is that it takes less time to do the VFP equivalent of dereferencing a pointer to an object, because & can refer to anything, including a very long executable expression, so there's a lot more parsing that goes on with &.

But I dispute the "whenever possible" recommendation, because to use EVALUATE() requires at least two lines of code: assign the results of EVALUATE() to a variable, and then do something with the variable. In most cases, it takes four lines, because if you're following good procedure, you need a line to declare the scope of that variable and then a line to assign it a default value before you can use it. So the only time this matters would be in a situation where the & is executed more than once on the same value.

In any case, we're most likely dealing with time intervals of a few thousandths of a second, so in the scheme of things...

I understand Gene's remark about apostasy. One can almost guarantee that any time somebody recommends using & for something, somebody will immediately jump in and say, No no no! Don't do that! It's a rote response not always--or even maybe, often--justified by the specific circumstances.

Ken Dibble
www.stic-cil.org

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to