>>Hi,
>>
>>Given alias of current table in cAlias and field name of one of its field cField:
>>
>>Is EVALUATE(cAlias + [.] + cField) or &cAlias..&cField better way to retrive field value?
>>
>>In this case, when alias and field name are both in variable, is there any other way to retrieve the field value?
>
>The first is much better. evaluate is the only way, like you showed (the table should be opened with the alias cAlias)
>
>See Choosing between Macro substitution and Name expressions FAQ #7841
>>Hi,
>>
>>Given alias of current table in cAlias and field name of one of its field cField:
>>
>>Is EVALUATE(cAlias + [.] + cField) or &cAlias..&cField better way to retrive field value?
>>
>>In this case, when alias and field name are both in variable, is there any other way to retrieve the field value?
>
>The first is much better. I believe evaluate is the only way, like you showed.
I find this in Hacker's Guide:
"In a command that will be executed repeatedly, it's generally better to use a macro than EVALUATE(). The macro is expanded once and substituted into the command while an EVALUATE() expression is evaluated each time the command executes. This is also true for scoped commands that apply to multiple records, like the BROWSE above. The macro is expanded once and the result used on each record; EVALUATE() is re-evaluated for each record. So, for the BROWSE above, you're better off issuing:
BROWSE FOR &cExpression
"
It seems that if I need to feed a scope command with field (which is determined by variables) value, I should use the latter, otherwise if I only need to retrieve the field value once, then may be I should use EVALUATE().
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only