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 - Show more from this author
TonicNote, Inc.
https://tonicnote.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.

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: