list.walk ( )

Function stats

Average user rating
3.0000
29
74
9999
Support
FileMaker 8.5 +
Date posted
16 November 2008
Last updated
07 December 2008
Version
1
Recursive function
Yes

Author Info
 Genx

18 functions

Average Rating 4.1

author_avatar



 

Function overview

Prototype

list.walk  ( functionName;   listValues )


Parameters

functionName  A string containing a function name followed by multiple parameters to be passed to the function (these are ; delimited - see the example).


listValues  The List To Process


Description

Tags:  Walk   List  

The function is designed to process every value in the provided list according to the function provided in the first parameter. Note that this function will only work if the function you are applying to it takes a value as it's first parameter.

Additionally note that you can specify multiple parameters for the function after the value by adding semi colons (see the example).

Examples

Sample input

list.walk( "Upper" ; list.walk( "Left;2" ; "John¶mary;¶kAte" ) )


Sample output

JO¶MA¶KA

 

Function code

Let([
    f = Substitute( functionName ; ";" ; "¶" );
    fName = GetValue(f;1);
    fParams = If( ValueCount(f) > 1 ; ";" & Substitute( MiddleValues( f ; 2 ; ValueCount(f) - 1 ) ; "¶" ; ";" ) );
    fParams = Left( fParams ; Length(fParams) - 1 );
    valCount = ValueCount(listValues)
];
Evaluate(fName & "(" & Quote(GetValue(listValues ; 1)) & fParams & ")") &
    If( valCount > 0 ; ¶ & list.walk( functionName ; MiddleValues( listValues ; 2 ; valCount - 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/74

    Prototype: list.walk( functionName; listValues )
    Function Author: Genx (http://www.fmfunctions.com/mid/29)
    Last updated: 07 December 2008
    Version: 1

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

 

Comments

Michael Petrov
24 November 2008



I think your function prototype is incorrect in this one, it should include two parameters.
  General comment
Genx
24 November 2008



Thanks Michael :) That could have been a doozy.
(Edited by Genx on 04/12/08 )
  General comment

 

 

 

 

 

Top Tags

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