Hi,

>> You can even create a simple macro:
>> 
>>   #xtranslate FIELDGETBYNAME( <name> ) => FIELDGET( FIELDPOS( <name> ) )
>> 
>> and use:
>> 
>>   RETURN FIELDGETBYNAME( name )
> 
> Compare the ease of writing and understanding:
> 
> 1. ALIAS1->&("NAME1") + = ALIAS2->&("NAME2") + something
> 2. ALIAS1->(FIELDPUTBYNAME( "NAME1", FIELDGETBYNAME("NAME1") +
> ALIAS2->(FIELDGETBYNAME( "NAME2")) + something ))
> 
> IMO first version is still better

Aside from subjective matters: First version is less 
efficient. If you don't mind it, it's fine.

Though in your first example you cited a quite 
different situation (and that was the actual point 
of your question), so I'm not sure what you really 
want to achieve.

> The issue arose from the fact that it works in the PRG, but in the
> macro and the HRB does not work (although the HRB compile as usual
> PRG)

Okay, so there is another disadvantage of macro 
expansion.

Me personally never use macro expansion except 
very few selected places (indexes and custom 
filter assembly).

Anyway as someone pointed, what you want is not 
Clipper compatible. I'm almost sure the double 
macro expansion + codeblock creation and 
evaluation is unnecessary, so IMO you just have 
to clean it and it will work.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to