Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EVALUATE and macro substitution alternatives
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00385373
Message ID:
00385948
Views:
17
>>>"when you need macro substitution, you need it!"
>>>
>>>I agree completely. We've come up with a solution that, although involves a lot of changes, will give us flexibility down the road. Thanks for your help.
>>
>>What's the difference between:
>>fldname='MyTable1.field1'
>>replfldname='MyTable2.field2'
>>replace (fldname) with evaluate(replfldname)
>>
>>versa
>>
>>replace &fldname. with &replfldname.
>>
>>What would be more efficient?
>>
>>Thanks in advance.
>
>

>Nadya,
>
>The Name Expression (fldname) is fater then evaluate(replfldname)
>wich in turn is faster than macro substitution.

Sergey,

Thanks for your response.

Ok, so I was right in my assumption that the first code example is more effective, than the second. This is the example of real life. I've just changed the second code example (written by other programmer) to the first syntax.
The question is: what's the real difference (suppose, you're doing this in a scan loop) and is it worth to bothering to re-write?

I also found a lot of code like this:
thetable='blablabla'
use &thetable.

It's obviously not right and even may cause a syntax problem, if thetable contains embedded spaces by any chance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform