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
*/
// ===================================
/*__LITBR____LITBR__Name:__LITBR__array.value__LITBR____LITBR__History:__LITBR__Created by Tim Anderson, Tim Anderson Group__LITBR__www.timanderson.co.uk__LITBR__Creation Date: 5 January 2009__LITBR____LITBR__ __LITBR__Purpose: __LITBR__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.__LITBR____LITBR__Parameters: __LITBR__array__LITBR__rowName__LITBR__column__LITBR__delimiter__LITBR__ __LITBR__Example: __LITBR__array.value ( array ; "jelly" ; 2 ; "§" ) gives "very wobbly" (no quotes) where array is__LITBR__row1§40§200__LITBR__row2§200§40__LITBR__jelly§very wobbly§raspberry__LITBR__ __LITBR____LITBR__Requires Other Custom Functions:__LITBR__None__LITBR____LITBR__Other Notes:__LITBR__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__LITBR____LITBR__Options:__LITBR__None__LITBR____LITBR__*/ __LITBR__Let([_rname="¶" & rowName & "§";__LITBR__ _string=Right("¶" & array;Length(array)-Position("¶" & array;_rname;1;1));__LITBR__ _row=Left(_string;Position(_string;"¶";1;1))];__LITBR__GetValue(Substitute(_row;delimiter;"¶");column)__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/172__LITBR____LITBR__ Prototype: array.value( array; rowName; column; delimiter )__LITBR__ Function Author: TimA (http://www.fmfunctions.com/mid/102)__LITBR__ Last updated: 06 January 2009__LITBR__ Version: 2.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.