Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programming archeology
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00204262
Message ID:
00204570
Views:
24
>>Many years ago, more than I care to remember, I used to program accounting machines. One thing all our "programs" had was a check digit appended at the end of numeric codes so that it was easy to detect misstypings. I cannot remember how those check digits were calculated but it had to be very simple: only the most expensive machines could multiply or divide. Anybody knows how the check digit was calculated?
>
>> I am taking a few days off, the first in several months, and I know that not having the answer risks spoiling the fun.
>
>That we dooooo not want.
>
>for 1 digit they take mod(x,7) where x is the number without check digit. For a 2 digit check they would take mod(x,93).
>
>They may not have been able to multiply or devide, but they could 'shift' 'push' and 'pop' like nobody can today if my memory is correct :)
>
>Marc

Hi Marc,

Belgian bank accounts have the following format, (as you may know...) 340-0551143-27 (the next one would be 340-0551144-28)

Here is the valid from my cBankTextBox.
*---------------------- Location Section ----------------------
*  Library...........: common30\ccustctl.vcx
*  Class.............: Cbanquetextbox
*  Method............: Valid()
*-------------------------- Copyright -------------------------
*  Author............: José Constant                      
*  Project...........: Prosal                             
*  Created...........: 11/07/96  15:01:56
*  Copyright.........: (c) Terre-Engineering S.A.             , 1996
*----------------------- Usage Section ------------------------

LOCAL lAg,  ;
      lCp,  ; 
      lMod, ;
      lAgcp

lAg = SUBSTR(this.value,1,3) 
lCp = SUBSTR(this.value,4,7) 
lMod = SUBSTR(this.value,11,2) 
lAgCp = lAg + lCp

IF this.Value = "000000000000";
 .OR. this.Value = "903000900379";
 .OR. lCp = "0000000"
  this.value = ""
  this.Refresh()
ELSE
	IF VAL(lAgcp) = 0 .AND. VAL(lMod) =97
	  RETURN .T.
	ELSE
	  IF MOD(VAL(lAgcp),97)=0 .AND. VAL(lMod) = 97
	    RETURN .T.
	  ELSE
	    IF MOD(VAL(lAgcp),97) <> VAL(lMOD)
	      =ErrorMsg(ILLEGALVALUE_LOC)
	      RETURN .F.
      ELSE
	      RETURN .T.
	    ENDIF
	  ENDIF
	ENDIF
ENDIF

RETURN
By the way, Marc, I found back the guy I was researching by checking the phone guides on the Web. He was second on the list I tried!

José
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform