Hi Joseph, first thank you for your quick respons; I changed the code so that 0 is also accepted as a good result
thx
Marioway
Main Topics
Browse All TopicsHi, I want to find out if the account nummer is correct. Following code worked perfect, but on a certain number, it gave me an exception.
737-0250120-97
DIVISION OF 7370250120 by 97 : rest is 0 --> should I correct the code --> adding if ... is 0 then everything is fine ?
thx
Marioway
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: JosephGloszPosted on 2008-09-09 at 13:01:33ID: 22431601
Well, if you do the division on a calculator, you'll see the mod result is indeed 0. So there is no issue there.
2.Text, 2));
You'll have to check the original computation algorithm to make sure you haven't oversimplified it. Because it find it highly suspect that the condition is good if X mod 97 = Y (where Y is the last 2 digits of the account number), but when Y happens to equal your hard-coded '97' mod divisor then it comes out to exactly zero??
I'll bet the function is more along the lines of
var
Good: boolean;
begin....etc...
Divisor := IntToStr(RightStr(MaskEdit
Good := (Nummer MOD Divisor) = 0;
If the above isn't the right way to do it then I don't think you can just accept zero as a good result, unless all the numbers that can be divided by 97 evenly will be good account numbers.