Passing multiple arguments to a :post_script

瀏覽次數:30 次
跳到第一則未讀訊息

Jim Polk

未讀,
2012年9月6日 下午5:46:082012/9/6
收件者:rfmcom...@googlegroups.com

I see in layout.rb, some documentation that reads:

  # ==Passing Parameters to a Script
  #
  # If you want to pass a parameter to the script, use the options above, but supply an array value
  # instead of a single string. For example:
  #
  #   myLayout.find({"First Name" => "Bill"}, :post_script => ["Remove Duplicates", 10])
  #
  # This sample runs the script called "Remove Duplicates" and passes it the value +10+ as its
  # script parameter.

But what if you need to pass more than one argument?...Can Rfm handle that?...and if so, what would the syntax look like?

Like so?

myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript", "this", "that","etc"] )

or

myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript", ["this", "that","etc"]  ] )

or

args = [ "this", "that", "etc"]
myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript",  args]  )

or perhaps some other syntax?

Almost all the data I need to pass is textual, and not numerical....

Thanks!!


wbr

未讀,
2013年2月16日 凌晨3:46:282013/2/16
收件者:rfmcom...@googlegroups.com
Unfortunately, Filemaker scripts can only accept a single parameter. If you want to pass multiple parameters, be it thru the XML interface or via Filemaker client, you must roll your own by passing a single string of parameters separated by some character. Then parse the string on the Filemaker side.


回覆所有人
回覆作者
轉寄
0 則新訊息