Brian Dunning's FileMaker Custom Functions

Array.SetCell ( array ; columnName ; rowName ; delimiter ; value )

Set a cell within a text array - useful for creating sparse CSV data for virtual list export.

  Average rating: 4.6 (26 votes) Log in to vote

Richard Dyce   Richard Dyce - Show more from this author
Dyce & Sons Ltd.
http://dyce.com

Share on Facebook Share on Twitter

  Sample input:
Array.SetCell ( ".A.B.C.D¶1.0.0.0.0¶2.0.0.0.0¶3.0.0.0.0" ; "B" ; "2" ; "." ; "X" )
  Sample output:
".A.B.C.D¶1.0.0.0.0¶2.0.X.0.0¶3.0.0.0.0"

i.e.

.A.B.C.D
1.0.0.0.0
2.0.X.0.0
3.0.0.0.0

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The function allows you to add to an existing array, created with say Array.Create(). Because you can change the delimiter it makes export sparse CSV data easier; create an empty array; fetch the data from an SQL query that returns a list of colName,rowName,value tuples; iterate over the list using Array.SetCell to fill in the blanks in the empty array.

Edited to make parameter order match other functions.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: