If i'm correct and MOD returns the remainder then this function should help i think:
rem remainder function
function rem(num1,num2)
dim temp(3)
temp(2) = int(num1/num2)
temp(1) = temp(2) - 1
temp(3) = temp(2) + 1
if (num2 * temp(2)) < num1
num3 = num1 - (num2 * temp(2))
exitfunction num3
endif
if (num2 * temp(1)) < num1
num3 = num1 - (num2 * temp(1))
exitfunction num3
endif
if (num2 * temp(3)) < num1
num3 = num1 - (num2 * temp(3))
exitfunction num3
endif
endfunction
theres no remainder (MOD) function in db classic so i made this one part of a common code project. you put in the two numbers (num1 > num2) and it resturns the remainder, have not tested for -ve numbers yet
your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX