>Macro substitution is obviously a legitimate programming technique and one which I think is awesomely powerful. However, it is also a very often miss-used technique.
Personally, I think macro substitution can be justified for simplifying SQL - SELECT statements with lots of variable information (see my reply to Peter), and in some other cases where it turns out that many more commands are required if you insist on avoiding macro substitution. One interesting example is to restore SET settings:
set talk &lcOldTalk
is one single command. To avoid macro substitution, you would need five:
if lcOldTalk = "ON"
set talk on
else
set talk off
endif
If the saving / restoring is done frequently, it might be worthwhile to investigate which version is faster. (Is it the second version? I suppose so, but I am not sure in this case). Otherwise, I would prefer the single command.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)