Public Function ModOffsetByOne( _ ByVal vX As Variant _ , ByVal vY As Variant _ ) As Variant
Y = 4 or Y = -4:
* * * * | * * * | * * * |* * * ------------+------------ * * *| * * * | * * * | * * * |
ModOffsetByOne(-4, 3) = -1 ModOffsetByOne(-3, 3) = -3 ModOffsetByOne(-2, 3) = -2 ModOffsetByOne(-1, 3) = -1 ModOffsetByOne(0, 3) = 3 ModOffsetByOne(1, 3) = 1 ModOffsetByOne(2, 3) = 2 ModOffsetByOne(3, 3) = 3 ModOffsetByOne(4, 3) = 1See also:
ModOffsetByOneVerify Subroutine ModStd Function DivideOffsetByOne Function Sgn Function (Visual Basic)vX: See the Definition. Function returns Null if vX is Null or cannot be fixed up to a number.
vY: See the Definition. Function returns Null if vY is Null or cannot be fixed up to a number.
Definition:
If X == 0: X If X <> 0: ModStd(X - Sgn(X), Y) + Sgn(X)
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.