As a default, the variables used in a function are local and parameters are copies and results are copies. Global variables allow multiple functions to share variables with each other.
In this program there isn't really a counter like you see in programs that have while or for loops and a variable counting up or down. This program uses global variables A and B to pass a values to myTest and return a value. At any point in the function or Command Window you can set the variables to whatever you want: ex. A=0 B=1