On Thu, 20 Apr 2017 15:14:55 -0700, Gene Wirchenko genew@telus.net wrote:
Hello:
Suppose I wish to refer to a column. I have the alias in*text* form. What is the best way to access the column? By best, I mean a short, clear way that:
- can be used in both reads or writes on the column and
- is in-line: I do not want to have to define a variable with an
expression and then use that in a later line.
I have the rather ugly evaluate(aliasasstr+".colname")which I have used for years on occasion. Now, I am modifying a report where I will have to use this sort of access more than a few times.
Am I overlooking something cleaner?
Why not macro substitution?
&aliasasstr..colname
Note that the two dots are mandatory.
In many cases it is better to use macros because they are expanded and interpreted only one time.
For example in sql query, in filter condition, in for clauses.