The previous macro example requires the value for the parameter to be supplied each time the macro is invoked. It is only necessary to change the value of the parameter when for loops are nested. The macro definition can be improved further by giving the parameter a default value so it is not specified unless the default value cannot be used (such as in nested for loops).
A macro parameter is given a default value by specifying the value the first time the macro parameter is displayed in a macro definition:
for for {(}var ${1=a} = 0;; ${1}{+}{+}{)} {{}{ENTER 2}{}} {UP 2}{END}{LEFT 8}
The syntax ${1=a} assigns a as a default value to the parameter ${1}. If the macro is invoked with no value for ${1}, it expands to read:
for (var a = 0;; a++) {
}