Function overview
Prototype
RepeatPlus (
text; numberOfTimes )
Parameters
text any text expression or text field
numberOfTimes any numeric expression or field containing a number
Description
Tags:
text repeat
Repeats text the specified number of times.
This is a simple non-recursive calculation that extends the limit of allowable repeats up to 161,999 (with a plain Substitute ( 10^numberOfTimes - 1 ; "9" ; text ) the limit is 404 repeats, while the obvious recursive function would be limited to 10,000 recursions).
Examples
Sample input
Repeat ( "abc " ; 4 )
Sample output
abc abc abc abc
Function code
/*
Repeat function
Repeats text number of times
Author
*COMMENT Visual Realisation
Format
Repeat ( text ; numberOfTimes )
Parameters
text - any text expression or text field
numberOfTimes - integer
Data type returned
text
Description
Repeats text the specified number of times.
This simple non-recursive calculation extends the limit of allowable repeats up to 161,999 (with a plain Substitute ( 10^numberOfTimes - 1 ; "9" ; text ) the limit is 404 repeats, while the obvious recursive function would be limited to 10,000 recursions).
December 14, 2008
*/
Let ( [
a = Div (numberOfTimes; 400 ) ;
b= Mod (numberOfTimes; 400 )
] ;
Case ( a ; Substitute ( 10^a - 1 ; [ "9" ; 10^400 - 1 ] ; [ "9" ; text ] ) ) &
Case ( b ; Substitute ( 10^b - 1 ; "9" ; text ) )
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/148
Prototype: RepeatPlus( text; numberOfTimes )
Function Author: comment (http://www.fmfunctions.com/mid/108)
Last updated: 04 February 2009
Version: 1.3
*/
// ===================================
/*__LITBR__Repeat function__LITBR__Repeats text number of times__LITBR____LITBR__Author__LITBR__*COMMENT Visual Realisation__LITBR____LITBR__Format__LITBR__Repeat ( text ; numberOfTimes )__LITBR____LITBR__Parameters__LITBR__text - any text expression or text field__LITBR__numberOfTimes - integer__LITBR____LITBR__Data type returned__LITBR__text__LITBR____LITBR__Description__LITBR__Repeats text the specified number of times.__LITBR____LITBR__This simple non-recursive calculation extends the limit of allowable repeats up to 161,999 (with a plain Substitute ( 10^numberOfTimes - 1 ; "9" ; text ) the limit is 404 repeats, while the obvious recursive function would be limited to 10,000 recursions).__LITBR____LITBR__December 14, 2008__LITBR__*/__LITBR____LITBR____LITBR__Let ( [ __LITBR__a = Div (numberOfTimes; 400 ) ;__LITBR__b= Mod (numberOfTimes; 400 )__LITBR__] ;__LITBR__Case ( a ; Substitute ( 10^a - 1 ; [ "9" ; 10^400 - 1 ] ; [ "9" ; text ] ) ) &__LITBR__Case ( b ; Substitute ( 10^b - 1 ; "9" ; text ) )__LITBR__)__LITBR____LITBR____LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/148__LITBR____LITBR__ Prototype: RepeatPlus( text; numberOfTimes )__LITBR__ Function Author: comment (http://www.fmfunctions.com/mid/108)__LITBR__ Last updated: 04 February 2009__LITBR__ Version: 1.3__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.