DoubleInList ( )

Function stats

Average user rating
376
341
9999
Support
FileMaker 10.0 +
Date posted
22 November 2012
Last updated
22 November 2012
Version
Recursive function
Yes

Author Info
 Tanguy Colles

1 functions

Average Rating None

author_avatar



 

Function overview

Prototype

DoubleInList  ( _values )


Parameters

_values  list of values


Description

Tags:  List  

Returns values existing more than once in a list

Examples

Sample input

List ( "Albert";"Jean";"Albert";"Jacques";"Albert";"Jean";"Paul";"Patrick";"Alain")


Sample output

Albert
Jean

 

Function code

/*-------------------------------------
DoubleInList ( _values )
-------------------------------------
By Tanguy Colles BH&A 20121121
-------------------------------------
Returns values existing more than once in a list
-------------------------------------
Recursive Function - > limited
-------------------------------------

*/


Case (
    ValueCount ( _values ) > 0 ; List (
        If ( ValueCount ( FilterValues ( _values ; GetValue ( _values ; 1 ) ) ) > 1 ;
            GetValue ( _values ; 1 ) )
    ; DoubleInList ( RightValues ( Substitute ( ¶ & _values & ¶ ; ¶ & GetValue ( _values ; 1 ) & ¶; "¶" ) ; ValueCount ( _values ) - 1 ) ) )
    )

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

    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/341

    Prototype: DoubleInList( _values )
    Function Author: Tanguy Colles (http://www.fmfunctions.com/mid/376)
    Last updated: 22 November 2012
    Version: 1.3

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

 

Comments

Tanguy Colles
22 November 2012



This function in the current version in case sensitive...
  General comment
Fabrice
22 November 2012



Hi Tanguy,
didn't test it, but how could it be case sensitive? No function is case sensitive in it
  General comment
Tanguy Colles
22 November 2012



Hi red devil, ... substitute is case-sensitive...isn't it ?
(Edited by Tanguy Colles on 22/11/12 )
  General comment
Fabrice
22 November 2012



oooops. Hadn't seen it. Sorry :)
  General comment
Lxu
09 August 2014



I don't know if I did something wrong, but when I tested with a list of integer, it failed to find the numbers more than once. I also tested the example with modification by added an extra name in the second position, the function was broken by returning only "Albert", not "Jean" any more.
 Bug report

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
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  (7)