Brian Dunning's FileMaker Custom Functions

FormatList ( TheList ; Adjust ; LenX )

Format of every element of a given List

  Average rating: 4.2 (42 votes) Log in to vote

Therese Telepski   Therese Telepski
Art + Promotion
http://www.art-promo.de

Share on Facebook Share on Twitter

  Sample input:
FormatList( "1¶13¶145" ; "r" ; 3 )
  Sample output:
__1¶
_12¶
145

(The underscores are blanks in real output. In HTML here pure blanks are truncated, whereas   or & are shown as is.)

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

Based on 'AddConstantToListValues' by Simon Plint.

Sometimes it may be useful to apply some formatting to every element of a list; e.g. if you want to convert it into a formatted one line text string where every element is represented as an equidistant item. E.g. think of an attendance sheet for a recurring event like sports training etc., where the number of attendants may vary from 5 to 50.

The function adds white spaces to every element of the list, either right or left hand according to parameter 'Adjust', till the total length of that element reaches LenX.

Of course the blank spaces can be replaced by underscores or an arbitrary character given as a fourth parameter if needed and wanted.

The function is called recursively till the whole list is worked down.

To convert it to a single line just add a command like the following after applying the above format:
Substitute ( FormattedList ; "¶" ; Separator )

 

Comments

Lee Smith   Lee Smith
Jun 21, 2010
There is something wrong with your Custom Function.

The edit box doesn't want to accept Bündig =, and breaks there.

Is this a Function that we should have already.
 
Therese Telepski   Therese Telepski, Suestedt, Germany
Jun 21, 2010
Sorry, of course it has to be 'Adjust', not 'Bündig'.

I created this on a German system and had to translate every function back into English again -- and for sake of comprehensibility I did the same with the variable names, missing the one you mentioned.

Hope everything is straightened out now and working.

Sincerely,

Therese
 

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.