Brian Dunning's FileMaker Custom Functions

SerializeValues ( textToIncrement ; listOfValues ; incrementBy )

Prefixes values in a list with a serial text/number combination.

  Average rating: 4.1 (39 votes) Log in to vote

Michael Horak   Michael Horak - Show more from this author
*COMMENT Visual Realisation

Share on Facebook Share on Twitter

  Sample input:
SerializeValues ( "0. " ; "a¶b¶c" ; 1 )


SerializeValues (
"Chapter 0 "; "Alpha¶Bravo¶Charlie¶Delta¶Echo";
2 )
  Sample output:
1. a
2. b
3. c


Chapter 2 Alpha
Chapter 4 Bravo
Chapter 6 Charlie
Chapter 8 Delta
Chapter 10 Echo

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

Returns listOfValues with each value prefixed by textToIncrement incremented by the value specified in incrementBy. You can use positive or negative incrementBy values. A fractional incrementBy value will be rounded to the nearest integer.

 

Comments

pepemac   pepemac, Ourense - Spain
Oct 17, 2014
Hello.
And...if you want to make a cumulative sum of list values?

For example:

List ("1¶3¶5")

Sample output:

1
4
9

How can i do?
Thanks.
 
 
Nov 16, 2015
In FM13, the second example returns

Alpha
Bravo
Charlie
Delta
2Chapter 0 <tab>
Chapter 10 <tab> Echo
 
suresh   suresh
Mar 22, 2016
In above function there is a mistake in first case, Please copy and paste the below function:

Let (

[
countValues = ValueCount ( listOfValues )
] ;



Case ( countValues > 1 ; SerializeValues ( textToIncrement ; LeftValues ( listOfValues ; countValues - 1 ) ; incrementBy ) & ¶ )
&
Case ( countValues ; SerialIncrement ( textToIncrement ; countValues * incrementBy ) & GetValue ( listOfValues ; countValues ) )
)
 

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 15 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: