Brian Dunning's FileMaker Custom Functions

RepeatValue ( Text ; NumRepeat )

Return return separated text of "Text" repeated "NumRepeat" times.

  Average rating: 4.5 (29 votes) Log in to vote

Koji Takeuchi   Koji Takeuchi
TonicNote, Inc.
https://tonic-note.com

Share on Facebook Share on Twitter

  Sample input:
RepeatValue ( "foo" ; 4 )
  Sample output:
"foo¶foo¶foo¶foo"

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

/*
RepeatValue ( Text ; NumRepeat )
2009.03.04, Koji Takeuchi


description:
Return return separated text of "Text" repeated "NumRepeat" times.
ex.
RepeatValue ( "foo" ; 4 )
-> "foo¶foo¶foo¶foo"
*/

 

Comments

Matthew Dahlquist   Matthew Dahlquist, Minneapolis
Mar 29, 2016
Discovered that, when feeing in a repeat value programmatically, a repeat value of 0 would act as if a repeat value of 1 rather than returning an empty result.

Case (
numRepeat > 1 ; RepeatValue ( text ; numRepeat - 1 ) & "¶" & Text ;
numRepeat < 1 ; "" ;
Text
)

fixes that.
 

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.