DiffValues ( )

Function stats

Average user rating
132
186
9999
Support
FileMaker 7.0 +
Date posted
14 January 2009
Version
1
Recursive function
Yes

Author Info
 Charlie

7 functions

Average Rating 4.7

author_avatar



 

Function overview

Prototype

DiffValues  ( pTextToFilter;   pFilterValues )


Parameters

pTextToFilter  Value list to filter. This can be any text expression or text field.


pFilterValues  Values that you want to exclude in the specified text.


Description

Tags:  Values   Filter  

Returns a text result only containing values that were not provided in pFilterValues, in the order that they were originally entered in pTextToFilter. If pFilterValues doesn't have any values, an empty string is returned.

Values are text items separated by carriage returns. A value can be empty, a single character, a word, a sentence, or a paragraph. When you press Enter or Return, you start creating a new value. The last value will be recognized with or without a carriage return.

When the pTextToFilter or the pFilterValues parameter is a literal string, you must insert a paragraph character (¶) between each item in the string. To insert a carriage return character, click the ¶ button in the Specify Calculation dialog box.

The DiffValues function is not case-sensitive.

Examples

Sample input

DiffValues( list(1;2;3;4;5;6;7;8;9) ; list(1;2;3;4;7;8;9) )


Sample output

5
6

 

Function code

Let(
_TextToFilter = Substitute( ¶ & pTextToFilter & ¶ ; ¶ & LeftValues( pFilterValues ; 1 ) ; ¶ ) ;

If( ValueCount( pFilterValues ) <= 1 ; TrimCR( _TextToFilter ) ;
DiffValues( _TextToFilter ; RightValues( pFilterValues ; ValueCount( pFilterValues ) - 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/186

    Prototype: DiffValues( pTextToFilter; pFilterValues )
    Function Author: Charlie (http://www.fmfunctions.com/mid/132)
    Last updated: 14 January 2009
    Version: 1

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