[DUG] Bank acc No's

Neven MacEwan neven at mwk.co.nz
Tue Nov 22 16:03:42 NZDT 2005


Ahh Dataflex, I note this is Dataflex 3 with procedures and OO

Ross Levis wrote:
> I've got an old routine here written in Dataflex.  Several banks have 
> different routines.  I can help with any syntax queries.
> 
> Procedure sum string acc_no# integer digit integer weighting
>     Move (sum#+(integer(mid(acc_no#,1,digit))*weighting)) To sum#
> End_Procedure
> 
> Procedure sum2 string acc_no# integer digit integer weighting
>     Local Integer tmp#
>     Move (integer(mid(acc_no#,1,digit))*weighting) To tmp#
>     while tmp# gt 9
>         move (integer(mid(tmp#,1,1))+integer(mid(tmp#,1,2))) To tmp#
>     end
>     Move (sum#+tmp#) To sum#
> End_Procedure
> 
> Function Valid_Bank_Acc global string acc# returns integer
>     Local Integer cnt# len# bank#
>     Local String acc_no# char#
>     Length acc# to len#
>     for cnt# from 1 to len#
>        mid acc# to char# 1 cnt#
>        if (char#=>"0" and char#<="9") append acc_no# char#
>     loop
>     move 0 To sum#
>     left acc_no# to bank# 2
>     if bank# eq 8 begin
>       send sum acc_no#  7 7
>       send sum acc_no#  8 6
>       send sum acc_no#  9 5
>       send sum acc_no# 10 4
>       send sum acc_no# 11 3
>       send sum acc_no# 12 2
>       send sum acc_no# 13 1
>       move (sum#/11) to sum#
>     end
>     else if (bank#=25 or bank#=33) begin
>       send sum acc_no#  7 1
>       send sum acc_no#  8 7
>       send sum acc_no#  9 3
>       send sum acc_no# 10 1
>       send sum acc_no# 11 7
>       send sum acc_no# 12 3
>       send sum acc_no# 13 1
>       move (sum#/10) to sum#
>     end
>     else if bank# eq 29 begin
>       send sum2 acc_no#  7 1
>       send sum2 acc_no#  8 3
>       send sum2 acc_no#  9 7
>       send sum2 acc_no# 10 1
>       send sum2 acc_no# 11 3
>       send sum2 acc_no# 12 7
>       send sum2 acc_no# 13 1
>       send sum2 acc_no# 14 3
>       send sum2 acc_no# 15 7
>       send sum2 acc_no# 16 1
>       move (sum#/10) to sum#
>     end
>     else begin // standard
>       send sum acc_no#  3 6
>       send sum acc_no#  4 3
>       send sum acc_no#  5 7
>       send sum acc_no#  6 9
>       send sum acc_no#  8 10
>       send sum acc_no#  9 5
>       send sum acc_no# 10 8
>       send sum acc_no# 11 4
>       send sum acc_no# 12 2
>       send sum acc_no# 13 1
>       move (sum#/11) to sum#
>     end
>     Function_Return (sum#=integer(sum#))
> End_Function
> 
> Regards,
> Ross.
> 
> ----- Original Message ----- 
> From: "Rohit Gupta" <rohit at cfl.co.nz>
> To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
> Sent: Tuesday, November 22, 2005 2:30 PM
> Subject: RE: [DUG] Bank acc No's
> 
> 
> This is for making up files to send to the bank.  Its only a parity
> operation and pretty crappy.  Its used only to ensure that the data
> has not been corrupted.  Validation and Authorization is performed
> by the Banks own software running on the PC.
> 
> Subject:        RE: [DUG] Bank acc No's
> Date sent:      Tue, 22 Nov 2005 07:09:00 +0800
> From:           "Richard Vowles" <Richard.Vowles at borland.com>
> To:             "NZ Borland Developers Group - Delphi List" 
> <delphi at ns3.123.co.nz>
> Send reply to:  NZ Borland Developers Group - Delphi List 
> <delphi at ns3.123.co.nz>
> <mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
> <mailto:delphi-request at ns3.123.co.nz?subject=subscribe>
> 
> [ Double-click this line for list subscription options ]
> 
> I'm only going from my experience of publishing the checksum algorithm
> for Auckland University ID cards (for validation checking). I got in
> trouble over that one :-)
> 
> 
> ---
> Richard Vowles, Solutions Architect, Borland New Zealand
> email: richard.vowles at borland.com
> phone: +64-9-9184573
> cell: +64-21-467747
> other: MSN richard.vowles at borland.com, skype: rvowles
> 
> -----Original Message-----
> From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
> On Behalf Of Neven MacEwan
> Sent: Tuesday, 22 November 2005 10:07 a.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: Re: [DUG] Bank acc No's
> 
> So what, you could randomly deposit money into a bank, crime of the
> century!
> 
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> Regards
> 
> Rohit
> 
> ======================================================================
> CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
> PH    (649) 489-2280
> FX    (649) 489-2290
> email rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
> ======================================================================
> 
> 
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 
> 

-- 
Neven MacEwan (B.E. E&E)
Ph. 09 620 1356 Mob. 027 4749 062

New Address Details
===================
MWK Computer Systems
1 Taumata Rd
Sandringham
Auckland

Ph 620 1356
Fx 620 1336
-------------- next part --------------
A non-text attachment was scrubbed...
Name: neven.vcf
Type: text/x-vcard
Size: 164 bytes
Desc: not available
Url : http://ns3.123.co.nz/pipermail/delphi/attachments/20051122/daa24dc7/neven.vcf


More information about the Delphi mailing list