Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[TIP] Personal Script Paramater Parser...

Featured Replies

Now that we can pass a bunch of stuff via the script parameter I hate having to create a calc to parse it out every time...

I created the following Custom Function:

My_Scripts ( value )

Substitute ( MiddleValues ( Get ( ScriptParameter ) ; value ; 1 ) ; "

  • 2 weeks later...

Ocean West,

What a great idea! Wow! I've been doing the parse thing by hand ...

Thanks!

Ocean West -- I really liked this script. I wrote a companion function for it to send the multipart script parameter.

I defined 5 funtion parameters: ValueA, ValueB, ValueC, ValueD, ValueE

The function is then:

ValueA & "

  • Newbies

Hi guys: As with all things FM; there is another way to do this as well. Download the "Split" CF on Dunning's site and you can use this not only on script params, but elsewhere as well. The CF allows you to decide the split character on-the-fly. A script param may look like this: abc|pwr|xyz. You can get this in your script with a specification like this: Split ( Get ( ScriptParameter ); 2; "|" ) -> returns pwr.

  • 4 weeks later...

custom function paramByName(name)


=

Let(ParamValue = Evaluate(

" Let([" & Let(Plist = Trim(Substitute(Get(ScriptParameter);

// Deal with empty parameters

[":";"="];["

Smorr,

What exactly is the #8800? When you copy and paste your code, FileMaker wants it to be a parameter.

&#8800 is HTML for <> (not equal to). There appears to be a parameter missing after it, specifying what it should not equal.

I didn't invent this, but I found it so useful and elegant I began using it with the solution I just began building.

Here's the custom function:

// This system passes parameters to scripts in the form of "Parameter1 = "Param1"; Parameter2 = "Param2"".

// This function will extract the named parameter from the full script parameter, so that calling, when the above

// was passed, GetParameter( "Parameter1" ), will return "Param1".



Evaluate( "Let ( [ " & Get( ScriptParameter ) & " ]; " & ParameterName & " )" )




This is from the Using FileMaker 7 book. Number of parameters are effectively unlimited, can be in any order. Escaping the quotes makes string parameters a bit difficult to read, but I quickly got used to that. I used to use the pipe character as my delimiter, but find this much more flexible.



BTW, another technique I use is that when my scripts require a parameter, I place parameter names in parentheses. For instance, I have a script called "Edit Record( TableName, RecordID )" which is meant to take two parameters. Assuming I'm editing a address record that appears in a portal from a contacts table, I could call this with a parameter that looks like:




"TableName = "Addresses"; RecordID = "" & AddressesForContacts::AddressID & """

Chuck

  • 1 year later...

See related discussion here: http://fmforums.com/forum/showtopic.php?next_end/1/fid/36/tid/172008/

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.