Sorry guys, I keep having to search to get the results. For some reason DIV and MOD usage are not explained anywhere on the online help. So I just want to put this here so I can book mark to it. And yes, I do use mibuso for some of my code repository.

The Integer Divide (DIV) OperatorThe integer divide operator is used only as a binary operator. Its purpose is todivide the numeric term preceding it by the numeric term following it. The resulttype of this division is always of type Integer. If the second term is zero (0), arun-time error occurs. Any decimals that resulted from an ordinary division aredropped. Therefore, the result of 17 DIV 8 is 2, whereas the result of 17 DIV 9 is1.The Modulus (MOD) OperatorThe modulus operator (or the remainder operator) is used only as a binaryoperator. Its purpose is to divide the numeric term preceding it by the numericterm following it by using the integer division method and then return theremainder of that division. The result of this operation is always of type Integer.If the second term is zero (0), a run-time error occurs. The following showsexamples of modulus operator usage.• 17 MOD 8 = 1• 17 MOD 9 = 8The modulus operator requires two numbers. The first number is the one that isconverted by using the modulus function and the second number represents thenumber system being used. By definition the number system starts at zero andends at the second number minus one. For example, if the second number is ten,the number system that is used is from zero to nine. Therefore, the modulusrepresents what the first number converts to, if the numbering system only hadthe number of values indicated by the second number and the first number isforced to restart from zero.The following example shows several modulus operations:• 15 modulus 10 is 5 (because 9 is the last number available, 10 isrepresented by going back from the start, or zero, 11 is 1, 12 is 2, andso on)• 6 modulus 10 is 6• 10 modulus 10 is 0• 127 modulus 10 is 7The result is the same if the first number is divided by the second by using aninteger only and the remainder is returned as the value.

_________________smile alwaysshonaThat which you seek inside is that which you find outside

I use it in a check when we split PO's due to 1/2 30 days 1/2/ 60 days terms.We used to manually cut the Qty to Invoice in half , which therefor cuts the invoice amount in half.Then we post with 30 days terms. Then we post the (remaining) other half with 60 days terms.Giving us two vendor ledger entries with the correct terms. But then we started getting these terms on PO's that had 100 items and manually this was exhausting. So using MOD I can see if the amount is cleanly divisible by 2 & if not it gives us a message to check the Item and handle that manually.

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum