array.value ( )

Function stats

Average user rating
5.0000
102
172
9999
Support
FileMaker 8.0 +
Date posted
06 January 2009
Last updated
06 January 2009
Version
Recursive function
No

Author Info
 TimA

5 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

array.value  ( array;   rowName;   column;   delimiter )


Parameters

array  


rowName  


column  


delimiter  


Description

Tags:  Text Parsing   array  

Purpose:
A function to return the column value from an array by specifying the row name. Row names must be unique or only the first occurrance will be returned.

Parameters:
array
rowName
column
delimiter

Example:
array.value ( array ; "jelly" ; 2 ; "§" ) gives "very wobbly" (no quotes) where array is
row1§40§200
row2§200§40
jelly§very wobbly§raspberry

Examples

Sample input

array.value ( array ; "jelly" ; 2 ; "§" )
where array is
row1§40§200
row2§200§40
jelly§very wobbly§raspberry


Sample output

very wobbly

 

Function code

/*

Name:
array.value

History:
Created by Tim Anderson, Tim Anderson Group
www.timanderson.co.uk
Creation Date: 5 January 2009


Purpose:
A function to return the column value from an array by specifying the row name. Row names must be unique or only the first occurrance will be returned.

Parameters:
array
rowName
column
delimiter

Example:
array.value ( array ; "jelly" ; 2 ; "§" ) gives "very wobbly" (no quotes) where array is
row1§40§200
row2§200§40
jelly§very wobbly§raspberry


Requires Other Custom Functions:
None

Other Notes:
there is likely to be a more elegant way of isolating the row, but this works! Have included the option to specify the delimiter to allow use with any type of array

Options:
None

*/
Let([_rname="¶" & rowName & "§";
_string=Right("¶" & array;Length(array)-Position("¶" & array;_rname;1;1));
_row=Left(_string;Position(_string;"¶";1;1))];
GetValue(Substitute(_row;delimiter;"¶");column)
)

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

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

    Prototype: array.value( array; rowName; column; delimiter )
    Function Author: TimA (http://www.fmfunctions.com/mid/102)
    Last updated: 06 January 2009
    Version: 2.1

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

 

 

 

 

 

 

 

Top Tags

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