06-24-2003, 09:17 PM
Quote:I've tried the code and basically it counts starting at counter% until it hits max%, at which point it sets counter% to 0. Basically a normal counter. Works best in DO ... LOOPs. Might be used for a delay method.
Good observations, Seph.
Another use of this "increment and auto wrap at max" logic could be when you are processing a circular buffer whose size is a power of 2. Every time you access the buffer, you don't need to ask "I am at the end of the buffer?" and waste the execution time to test it.
*****
TO AGAMEMNUS:
It might be good if you gave us a hint as to what you want to do. Also, the clause after the ELSE has 2 instructions on it, which are not allowed.
*****