Brian Dunning's FileMaker Custom Functions

GetParameter ( subParameter )

Returns the specified “sub-parameter” of a given script parameter.

  Average rating: 3.6 (58 votes) Log in to vote

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

Share on Facebook Share on Twitter

  Sample input:
"orderID = 250; " &
"customerName = " & Quote("Jim Smith") & "; " &
"lineItemID = 15690"
  Sample output:
GetParameter("customerName")

-returns-

Jim Smith

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

Most methods of defining multiple script parameters require that the developer place the “sub-parameters” in a specific order and then call them by number. By using the Evaluate and Let functions, GetParameter( ) allows you to give each sub-parameter an intuitive name, then call it by name, regardless of where it falls in the full Script Parameter.

Not only is the order of the sub-parameters irrelevant, but so is the number of sub-parameters. If OrderID is the first of five subs in one Script Parameter and the eighth of fifteen in another, the function will work just as well.

Caveat: any sub-parameter that can conceivably be empty must be enclosed in a Quote( ) function. Otherwise, the Let( ) function within GetParameter( ) will fail.

Update: added error trapping for nonexistent subparameters.

 

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: