Gkirkup
04-28-2009, 01:19 PM
I have to change certain numeric locations in a warehouse, and the 'test' is that the last two digits divide by three with no remainder. (03, 12, 18, etc.)
Is there a function that I can use to identify these 'no remainder' numbers. (I as sure there a mathematical term for that, but cannot remember it.)
Robert
Uncle Gizmo
04-28-2009, 01:25 PM
I think the term you are looking for is MOD...
Uncle Gizmo
04-28-2009, 01:34 PM
I've just done a quick test, if you do this msgbox " >>> " & 10 Mod 3 the answer is 1, which is the "remainder" of the division of 10 by 3.
You could use the function to find when the remainder is zero.
gemma-the-husky
04-28-2009, 03:16 PM
are you trying to create a warehouse ref of this type, or verify that a ref is legitimate?
these are different things.
1. creating a ref, given a base ref and an offset is just something like
baseref x 100 + offset x 3
2. verfiying that any given number is legitimate if
legit = ((mynumber mod 100) mod 3) = 0
ie 123456, mod 100 is 56
56 mod 3 is 2, so legit = false in this instance.
--------------
assuming your warehouse refs are held as longs, note also that your numbers cant be over 9 digits long (well 10 at ap inch - maximum longint value is just over 2000 000 000), if they are longer you will need to look at different storage techniques, and you may possibly find problems with these mod functions