Brian Dunning's FileMaker Custom Functions

SortArray ( valueList ; sortDirection ; dataType )

Sort an array (text, number, date or time ) ascending or descending

  Average rating: 3.7 (52 votes) Log in to vote

Mogens Brun   Mogens Brun
FM Integrator
http://filemakerintegrator.dk

Share on Facebook Share on Twitter

  Sample input:
lorem
ipsum
dolor
sit
amet
consectetuer
adipiscing
elit
  Sample output:
adipiscing
amet
consectetuer
dolor
elit
ipsum
lorem
sit

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

Sort an array of either text, number, date or time values ascending or descending using the sort merge method (originally implemented for custom functions by Shaun Flisakowski and later by Theo Ros). The method is descriped in Wikipedia under "Merge sort".

Performance on a 1,66 GHz Mac Intel Core Duo: 50 word array: 60 msec. 100 word array: 150 msec. 500 word array : 1,1 sec. Sorting of dates are 30% faster.

20-25 times faster sorting of text arrays may be obtained using Troi Text Plug-in.

 

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.

Under construction. Email me your wish list for improvements.