CommunicationStructuree ( )

Function stats

Average user rating
37
321
9999
Support
FileMaker 7.0 +
Date posted
15 February 2012
Last updated
05 December 2017
Version
Recursive function
No

Author Info
 Fabrice

76 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

CommunicationStructuree  ( _string10char )


Parameters

_string10char  a 10 char long numeric string


Description

Tags:  Format  

BELGIAN payment reference system

Examples

Sample input

CommunicationStructuree ( 1013274810 )


Sample output

101/3274/81006

 

Function code

/*
CommunicationStructuree ( _string10char )

BELGIAN payment reference system

by Fabrice Nordmann,
1-more-thing

http://www.1-more-thing.com
http://www.twitter.com/1morethingtweet

_string10char : a 10 char long numeric string

sample input: 1234567890
sample output: 123/4567/89002 (formatted with / and appended the validation key, 02)

v3 - dec 2017: avoids endings in 00
v2 - sept 2015: now it works :)


*/

Let ([
    _input = _string10char ;
    _s = Left ( Filter ( _input ; "0123456789" ) & "0000000000" ; 10 );
    _s = Case ( not Mod ( GetAsNumber ( _s ) ; 97 ) ; GetAsNumber ( _s ) + 1 ; _s ) ; // avoid ending in 00
    _k = Right ( "00" & Mod ( _s ; 97 ) ; 2 )
];
    Left ( _s ; 3 ) & "/" & Middle ( _s ; 4 ; 4 ) & "/" & Right ( _s ; 3 ) & _k
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/321

    Prototype: CommunicationStructuree( _string10char )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 05 December 2017
    Version: 2.2

*/
// ===================================

 

Comments

Andries Heylen
08 January 2014



are you sure that you need the last "/" (between number and check?)
  General comment
Fabrice
08 January 2014



/ and - are not mandatory. Some banks display them, some don't. If you happen to communicate with an external system like Isabel, you can simply remove them.
  General comment

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (8)