August 17, 201114 yr 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
August 17, 201114 yr 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 February 16, 201213 yr by Fitch sadly, the wonderful comments on Todd's post were lost when he changed his blog format.
Create an account or sign in to comment