How can I make adjustable Merge Field names?
I have a couple of layouts with large quantities of Merge Fields (thank goodness for this capability). One layout contains 20 Merge Fields arranged in rows and columns. The script that sets these fields is identical or nearly identical for every field. For example, if I want to clear the fields, I must write 20 lines of script (eg set variable $$a1, "") for the first field and $$a2 for the next and so on. It would be much more effective if I could use $$an for the field names where $$a is common to all fields and n is a number (variable) that changes from 1 to 20. Then it would be a simple matter to use a For I = 1 to 20 Next script (the equivalent Loop steps) to clear all the fields. A second such loop could use the same concept to set the fields and since the script for setting the fields is identical or nearly so for each field, a huge amount of code could be eliminated.
I fooled around with the concept of adding a variable (eg "n") to the field name (eg "$$a" ) but didn't get anywhere.
Can this be done?