October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 67 | Play Back with a Count |
The Dot Formula can be an efficient editing strategy for a small number of repeats, but it can’t be executed with a count. Overcome this limitation by recording a cheap one-off macro and playing it back with a count.
In Tip 3, we used the Dot Formula to transform this:
| | var foo = "method("+argument1+","+argument2+")"; |
What we want is for it to look like this:
| | var foo = "method(" + argument1 + "," + argument2 + ")"; |
The Dot Formula meant that we could complete the task simply by repeating ;. a few times. What if we faced the same problem but on a larger scale?
| | x = "("+a+","+b+","+c+","+d+","+e+")"; |
We can approach this in exactly the same way. But when ...