Brian Dunning's FileMaker Custom Functions

DefineVariables ( global_boolean )

stores all passed variables as local ($) or global ($$) variables

  Be the first to rate this function Log in to vote

Jeff Drake   Jeff Drake - Show more from this author
Drakeling Technologies

Share on Facebook Share on Twitter

  Sample input:
Include the script step:

Set Variable [ $_ ; Value: DefineVariables ( True ) ]

…in a script with parameter:

List (
"customerID:15" ;
"orderID:" & 26 ;
"description:" & Quote ( "purchased by customer on¶date\: 28 Dec 2009" )
) //end List
  Sample output:
$_ will be empty, but the following variables are set:

$$customerID = 15
$$orderID = 26
$$description = "purchased by customer on¶date: 28 Dec 2009"

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

Purpose: Create local ($) or global ($$) variables from a return-delimited list of subparameters,
as specified in the script parameter and/or result. If the global_boolean is set to True, the function
will create global ($$) variables; if it is set to False, the function will create local ($) variables.


List (
"VariableName1:Value1" ;
"VariableName2:Value2" ;

) //end List

For ease of reading, the subparameters may be declared in separate strings, e.g.

"VariableName:" & "ValueName"

• DefineVariables_
• TrimFrom

Warning: if any variable contains a multiline value in which any subsequent line
begins with a single word followed by a colon, said colon must be preceded by a
backslash, e.g. "Four score and seven years ago, our fathers brought forth¶" &
"First\\: a new nation".

Note: includes dependencies to DefineVariables_ and TrimFrom custom functions.



Log in to post comments.


Note: these functions are not guaranteed or supported by 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 15 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: