Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4846 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello all;

i love the idea of using filemaker the way Matt does. makes sense to me, however the logic is very difficult compared to what i already knew in other languages.

If passing parameters using list. what r the rules or best practices for this.

e.g.

when user clicks on my button

1-> create a list first:: Button --> list ( "object =" & $object ; "row =" & $row;)

2-> main script:: Create a $var = (customfunction:: ( get (scriptparameter))

3-> if the $var was created, then do other logic

Also , can we get more "EXPLANATION" of the Let Function & Evaluate function as Matt uses these extensively & i love the use, it is just hard to wrap my head around the logic currently.

thanks everyone.

-imoree

Posted (edited)

I don't see anything wrong with your parameter passing steps, although I don't know that List gives you any particular advantage since even without it, you're still passing name-value pairs, which gives you all you need.

I generally do this:

1. Pass params: e.g., "id=" & IDfield & ";name=" & nameField & etc.

2. In script, set variable $param to Get( ScriptParameter )

3. Set each variable: $id = GetNamed( $param ; "id" )

The GetNamed function is one I got from SeedCode years ago (I was given the OK to post it):

Let ( [

  string = Substitute ( Text ; [ """ ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "" ;" ] ;

								[ "= " ; "=" ] ; ["=" ; " = "" ] ; [PP ; "~~" ] ) & """ ;

  eval = Evaluate ( "Let ( [" &  string  & "] ;" & Name & " )" ) ;

  result = Substitute (  eval ; [ "^^" ; """ ] ; [ "~~" ; PP ]  )

  ] ;  // where you see PP, replace with paragraph symbol, BBcode is messing it up



  If ( result ="?" ; "" ; result )

)

I'm going to punt on explaining Let and Evaluate -- do you have a specific question?

Meanwhile, you should read this, and the discussion that follows (see Edit: the original discussion is gone):

http://www.geistinte...iple-parameters

(Is Petrowsky the Matt you're talking about?)

Edited by Fitch
sadly, the wonderful comments on Todd's post were lost when he changed his blog format.

This topic is 4846 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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