Brian Dunning's FileMaker Custom Functions

NVPsInit ( InNVPs )

Converts a string of Name-Value Pairs into a return delimited list.

  Be the first to rate this function Log in to vote

Richard DeShong   Richard DeShong - Show more from this author
Logic Tools
http://logictools.com

Share on Facebook Share on Twitter

  Sample input:
NVPsInit ( "This=That|Those=Them|When=Now" )
  Sample output:
"This=That¶Those=Them¶When=Now"

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

This is an "initialization" function for the function: NVPsLoop().
The parameter, InNVPs, is a string of name-value pairs separated by vertical-bars (|).
The values in these pairs can have pilcro (return) characters.
The values cannot have vertical-bars.

Creates $pList as a return delimited list of the name-value pairs.
Creates $Formula for use in the NVPsLoop() function.

I use this function and NVPsLoop to parse the parameters passed to a script.
Example Script call: MyScript [ "This=That|Those=Them|When=Now" ]
Then within MyScript, I call this function, which converts the text string in a Name-Value list,
and then NVPsLoop, inside a Loop, create FM $vars for each Named instance:
$This = "That"
$Those = "Them"
$When = "Now"

 

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: