Mod 10 Function or 4.53 CDF guidance

Questions and Answers about DataEase for DOS

Re: Mod 10 Function or 4.53 CDF guidance

Postby earlwer » Wed Mar 20, 2013 10:11 pm

Adrian Jones wrote:Hi Fred,
Jerry's Mod10 as per the library you mentioned.
If I type the whole of the credit card number from three cards in front of me into the link, all return 0 -- i.e. pass.
If I type the same numbers into a field in DOS, another field derived "mod10 ( CardNo )" returns 0 on two of the cards and 1 for the third (which i assumes means it has not passed the test, as per your link).


No. The result of the mod10( data ) is a check digit between 0 to 9.
Find a 12/13 digit UPC/EAN code on an item you purchased at a retail store. (This should also work with one of your 13 digit EAN codes).

Eg. My box of tissues is marked with a UPC of 0 63435 71103 3 (Spaces added for clarity).

Create a text field for the ProductScan (14 digits).
Text because I don't want it zero filled.

Create a numeric 1 digit virtual field where the derivation is mod10( firstc(ProductScan,length(ProductScan)-1))

When you enter all the 12 digits into the ProductScan field, the mod10 function will evaluate the first 11 digits and should return a '3'. That is the check-digit.

The last digit of the ProductScan should be the same as the mod10() result.
earlwer
 
Posts: 15
Joined: Thu Dec 16, 2010 2:26 am
Location: Montreal, Quebec, Canada
Has thanked: 0 time
Been thanked: 0 time
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Adrian Jones » Thu Mar 21, 2013 9:04 am

Hi Earl,

Welcome to the Ffenics forum. What kept you! :)

The way you describe it was how I assumed this function was meant to work to begin with -- in other words, to generate the check digit.

I've just tried this again, and for the three 13-digit EANs on products on my desk (that I can read, anyway!), the function does return the check digit.

But it does not work for my three credit cards.

I had wondered/dimly recalled from the article that Graham wrote in Dialogue several years ago, if i had to exclude some of the starting digits, which identify the card type, but with one of my cards, no matter how many digits I remove from the front, the check digit at the end is never generated.

Are you posting from experience of using this specific function in Jerry's library?

Thanks.
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Graham Smith » Thu Mar 21, 2013 12:01 pm

It just occurred to me that Lawrence Fox had a check digit CDF in his Utilities CDF. Have you had a look at that?
Graham Smith
DataSmith, Delaware
"For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)
"X-Clacks-Overhead: GNU Terry Pratchett"
User avatar
Graham Smith
 
Posts: 2501
Joined: Fri Sep 07, 2007 11:31 am
Location: Delaware, USA
Has thanked: 0 time
Been thanked: 1 time
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Adrian Jones » Thu Mar 21, 2013 12:27 pm

For DOS, though?

I thought his functions were Windows-only.

Thanks for the suggestion, though!
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby earlwer » Thu Mar 21, 2013 3:38 pm

Adrian

> Welcome to the Ffenics forum. What kept you! :)
Busy, busy... and still working with DFD.

> But it does not work for my three credit cards.

Correct. I did a bit of research and concluded that Jerry's mod10() CDF is NOT the same algorithm that is used for Credit Card verification ;-(

Jerry's routine calculates the check-digits for UPC/EAN numbers.
It should not have been called a mod10 function.
The UPC/EAN numbers use a x3 weighing, which the credit card routine does not.

> Are you posting from experience of using this specific function in Jerry's
library?

Yes, since he wrote it for me. My version is called Earl.EXE.
It does all kinds of other stuff for Laser printers. Loading macros, printing Barcodes, etc.


So.... back to your problem.
It should be possible to write a DFD derivation that will return a 'valid/invalid' response. You may need multiple virtual fields.

I have written these in the past to verify Cell Phone ESNs and IMEI numbers.
earlwer
 
Posts: 15
Joined: Thu Dec 16, 2010 2:26 am
Location: Montreal, Quebec, Canada
Has thanked: 0 time
Been thanked: 0 time
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Graham Smith » Thu Mar 21, 2013 4:25 pm

Adrian Jones wrote:For DOS, though?

Sorry, I meant that you might contact him for the source code.
Graham Smith
DataSmith, Delaware
"For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)
"X-Clacks-Overhead: GNU Terry Pratchett"
User avatar
Graham Smith
 
Posts: 2501
Joined: Fri Sep 07, 2007 11:31 am
Location: Delaware, USA
Has thanked: 0 time
Been thanked: 1 time
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Adrian Jones » Fri Mar 22, 2013 12:19 pm

Hi Earl,

Thanks for the confirmation.

I'd write my own function if I knew how to write for DOS (and for DE-DOS), but I'm not aware of any documentation or templates out there to crib.

I'm fine writing windows functions.
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby Adrian Jones » Fri Mar 22, 2013 12:21 pm

Hi Graham,

The actual algorithm will be pretty easy to do and probably out there on the web.

The issue is how to write a DOS function. Even, with what to write one.
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Mod 10 Function or 4.53 CDF guidance

Postby John Middleton » Sun Mar 24, 2013 12:11 pm

Adrian

The odd couple of CDF’s that I wrote (back in day - circa 1992) for 4.53 were written in C (somewhere between version 5 or 6) - but I think Assembler could be utilised as well.

Neither CDF was entirely a hundred percent successful ( I’m no programmer!) I recall difficulties in case sensitivity and the appropriate switches to use upon compiling.

An extra floppy disk - entitled Quality Assurance Report - shipped with DE in those days, had some example CDFs, which with a little persistence could be adapted for own use.

Of course, in them days Jack Daniels wasn’t watered down to seventy odd percent proof, you could still buy Old Pulteney without needing a bank loan and B&B with a little weed was all you needed for inspiration!

John
ShopEase
John Middleton
 
Posts: 110
Joined: Mon Sep 10, 2007 3:14 pm
Location: England
Has thanked: 0 time
Been thanked: 1 time
 
 
Previous

Return to DataEase for DOS

Who is online

Users browsing this forum: No registered users and 3 guests

cron