Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROCEDURE String_CCP(Compte,CleeCCP,CleRIP are strings)
- // calcule clé CCP
- Compte = NumToString(Val(Compte),"010d")
- CleeCCP = Right(Val(Middle(Compte,1,1))*13 + Val(Middle(Compte,2,1))*12 +...
- Val(Middle(Compte,3,1))*11 + Val(Middle(Compte,4,1))*10 +...
- Val(Middle(Compte,5,1))*9 + Val(Middle(Compte,6,1))*8 +...
- Val(Middle(Compte,7,1))*7 + Val(Middle(Compte,8,1))*6 +...
- Val(Middle(Compte,9,1))*5 + Val(Middle(Compte,10,1))*4 ,2)
- // calcule clé RIP
- CleRIP = Val(Compte) * 100
- CleRIP = modulo(Val(CleRIP),97)
- CleRIP = Val(CleRIP) + 85
- IF Val(CleRIP) >= 97 THEN
- CleRIP = Val(CleRIP) - 97
- CleRIP = 97 - Val(CleRIP)
- CleRIP = Complete(Right("00"+ Val(CleRIP),2),2)
- ELSE
- CleRIP = 97 - Val(CleRIP)
- CleRIP = Complete(Right("00"+ Val(CleRIP) ,2),2)
- END
- //Usage
- String_CCP(SAI_CompteCCP,SAI_CleCCP,SAI_CleRIP)
- SAI_RIP = ChaîneConstruit("00799999%1%2", SAI_CompteCCP, SAI_CleRIP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement