I've developed 2 new functions to simplify circular numbers that is numbers that must have a range of values and be incremented/decremented by something but when they reach their bounds (upper or lower) they restart from the other side.
For example imagine you have a set of options from 1 to 4 and want always add 1 but when it reach 4, adding 1 will restart from 1. The same when subtracting 1 if it will reach 1 it will restart from 4.
I've developed the following 2 functions:
MyNumber = NNEXT(MyNumber, nMin, nMax, nIncr)
MyNumber = NPREV(MyNumber, nMin, nMax, nDecr)
but I do not like the names: NNEXT and NPREV.
Do you have something to suggest? I was thinking about CIRCULAR_NEXT and CIRCULAR_PREV
Ciao
Eros
Bookmarks