Brian Dunning's FileMaker Custom Functions

PutValue18 ( ValueList ; ValueNumber ; ReplaceString )

Replaces a designated value in a value list with another value

  Be the first to rate this function Log in to vote

Bill Thurmes   Bill Thurmes - Show more from this author
MDCA
http://www.miyotadca.com

Share on Facebook Share on Twitter

  Sample input:
PutValue18 ( "1¶3¶5" ; 2 ; "yellow" )
PutValue18 ( "1¶3¶5" ; 5 ; "yellow" )
  Sample output:
"1¶yellow¶5"
"1¶3¶5¶¶yellow"

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

Replaces a designated value with another value in ¶-delimited value list. If value list does not already contain ValueNumber values, adds extra values until ValueCount = ValueNumber. A compliment to GetValue.
Requires FMP 18 or later.
Just like PutValue, except that recursion (to bring ValueCount to ValueNumber) is replaced by While function, which just seems more elegant.
Note that ReplaceString can contain multiple values (separated by ¶), so Result may have more values than ValueList, but never fewer
(Note: if you continue using PutValue, for FMP versions previous to 18, a problem was fixed in Oct 2019.)

 

Comments

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: