array.cellValueByColNum ( )

Function stats

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

Author Info
 TimA

5 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

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


Parameters

array  


rowName  


column  


delimiter  


Description

Tags:  Text Parsing   cell   Array  

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

Have included the option to specify the delimiter for maximum flexibility. The first column with the row names is treated as row 0 (zero) for this cf. See also array.cellValueByColTitle

Examples

Sample input

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


Sample output

very wobbly

 

Function code

/*

Name:
array.cellValueByColNum

History:
Created by Tim Anderson, Tim Anderson Group
www.timanderson.co.uk
Creation Date: 5 January 2009
Modified: 6 Jan 2009 - Now treats row names as column 0 (zero) and changed name. See also array.cellValueByColTitle
15 Jan 2009 - Now does not return first row if ror name not in list


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.cellValueByColNum ( array ; "jelly" ; 1 ; "§" ) 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:
Have included the option to specify the delimiter for maximum flexibility. See also array.cellValueByColTitle

Options:
None

*/
Let([_rname="¶" & rowName & "§";
_notHere=PatternCount(array;_rname)=0;
_string=Right("¶" & array;Length(array)-Position("¶" & array;_rname;1;1));
_row=GetValue(_string;1)];
Choose(_notHere;GetValue(Substitute(_row;delimiter;"¶");column+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/173

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

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

 

 

 

 

 

 

 

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)