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" <[EMAIL PROTECTED]>
To: "NZ Borland Developers Group - Delphi List" <[email protected]>
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" <[EMAIL PROTECTED]>
To: "NZ Borland Developers Group - Delphi List" <[email protected]> Send reply to: NZ Borland Developers Group - Delphi List <[email protected]>
<mailto:[EMAIL PROTECTED]>
<mailto:[EMAIL PROTECTED]>

[ 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: [EMAIL PROTECTED]
phone: +64-9-9184573
cell: +64-21-467747
other: MSN [EMAIL PROTECTED], skype: rvowles

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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
[email protected]
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 [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
======================================================================


_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
[email protected]
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
begin:vcard
fn:Neven MacEwan
n:MacEwan;Neven
email;internet:[EMAIL PROTECTED]
tel;work:649 620 1356
tel;fax:649 620 1336
tel;cell:0274 749 062
version:2.1
end:vcard

_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to