The name expression will not work for '(laTmp[1])' because it's expression not a name.
SELECT EVALUATE(laTmp[1]) AS (lcNewField) ;
FROM (lcOldFile) ;
INTO TABLE lcNewFile DATABASE (lcTableDBC)
>In this case, neither EVAL() nor a macro is needed for most of what you're doing. Name substitution will do:
>
>
>SELECT (laTmp[1]) AS (lcNewField) ;
> FROM (lcOldFile) ;
> INTO TABLE lcNewFile DATABASE (lcTableDBC)
>
>
>I'm not 100% sure name substition works for the AS, but everywhere it will.
>
>Although most of the others recommend textmerge, I wouldn't bother in this case where name subsitution is enough. I find it much easier to read code that contains the actual SQL command than code that builds a string and executes it. While I haven't tested, I see no reason why this version would be slower.
>
--sb--