While FileMaker does not provide for true iterators within its calculation engine, it does provide the Loop  script step within its scripting engine. The following convention applies to iterations based on walking across data that may be contained within a variable.
The following convention is similar to that of a For loop within other languages.
The efficiency of this convention is such that the counter, the exit condition and the counter reset are maintained within the same calculation dialog box - all within the Exit Loop If step.
Using $i vs. $counter
Any value can be used for the counter within a data loop. This standard does not enforce the use of $i as your variable name for the counter, however, it is suggested. The use of $i as a convention is simply a matter of what is commonly used by many other programming languages. You can certainly use $n, $counter or any other variation desired. Simply make sure this same variable is not used within an embedded loop.