<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Passing Multiple Parameters to Scripts &#8211; Advanced</title>
	<atom:link href="http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/</link>
	<description>smart business solutions</description>
	<lastBuildDate>Fri, 18 May 2012 01:30:19 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-2092</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Mon, 21 Nov 2011 15:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-2092</guid>
		<description>Regine:

Hey, cool! We do the same thing. Very handy.</description>
		<content:encoded><![CDATA[<p>Regine:</p>
<p>Hey, cool! We do the same thing. Very handy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Regine</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-2091</link>
		<dc:creator>Regine</dc:creator>
		<pubDate>Mon, 21 Nov 2011 12:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-2091</guid>
		<description>Hi, I came across your article and found it very useful. 
I thought I test it with a script straight away, as I am sick of globals.
However I realized, that I need not only to pass on values to another subscript in a different file, but also to pass values back from this subscript to my main script.
I added a Exit Script step with all parameters set as normally in the script parameters in my Subscript.

I duplicated the GetParameter function called it ExitParameter. I simply replaced the Get(ScriptParameter) with Get(ScriptResult) and voila, I can extract all my parameters with the ExitParameter function and just continue in my main script.

Now I am busy re-writing my scripts.
Thanks a lot.

kind regards

Regine</description>
		<content:encoded><![CDATA[<p>Hi, I came across your article and found it very useful.<br />
I thought I test it with a script straight away, as I am sick of globals.<br />
However I realized, that I need not only to pass on values to another subscript in a different file, but also to pass values back from this subscript to my main script.<br />
I added a Exit Script step with all parameters set as normally in the script parameters in my Subscript.</p>
<p>I duplicated the GetParameter function called it ExitParameter. I simply replaced the Get(ScriptParameter) with Get(ScriptResult) and voila, I can extract all my parameters with the ExitParameter function and just continue in my main script.</p>
<p>Now I am busy re-writing my scripts.<br />
Thanks a lot.</p>
<p>kind regards</p>
<p>Regine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Mayers</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-2048</link>
		<dc:creator>Glen Mayers</dc:creator>
		<pubDate>Thu, 07 Apr 2011 21:40:36 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-2048</guid>
		<description>You have a great service. very very useful. Keep upthe good work</description>
		<content:encoded><![CDATA[<p>You have a great service. very very useful. Keep upthe good work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1803</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Sat, 13 Jun 2009 18:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1803</guid>
		<description>Bruce:

I think that&#039;s a great idea.

When I did the very first iteration of this whole set of ideas back when 7 was released, I used a JSON-like syntax, but not really JSON (it was actually based on OSX text plist format...). But it was harder to parse and produce.

Jesse built these from scratch with a few key goals in mind:

1: Resilient. I should be able to put any data, any characters, and any type into the dictionary without errors. (Container data being the notable exception.)

2: Nestable. I should be able to do &lt;code&gt;#(&quot;x&quot;, 1) &amp; #(&quot;y&quot;, #(&quot;y1&quot;, 2) &amp; #(&quot;y2&quot;, 3))&lt;/code&gt; with impunity. 

1: Decent performance (no character-by-character recursive processing)

So the question is, can we meet these goals with JSON? I&#039;m not sure... I&#039;m not entirely sure how big a deal #3 is, too. I &lt;em&gt;feel&lt;/em&gt; like it would be unacceptable to do this kind of recursion but I may be wrong.

Geoff</description>
		<content:encoded><![CDATA[<p>Bruce:</p>
<p>I think that&#8217;s a great idea.</p>
<p>When I did the very first iteration of this whole set of ideas back when 7 was released, I used a JSON-like syntax, but not really JSON (it was actually based on OSX text plist format&#8230;). But it was harder to parse and produce.</p>
<p>Jesse built these from scratch with a few key goals in mind:</p>
<p>1: Resilient. I should be able to put any data, any characters, and any type into the dictionary without errors. (Container data being the notable exception.)</p>
<p>2: Nestable. I should be able to do <code>#("x", 1) &#038; #("y", #("y1", 2) &#038; #("y2", 3))</code> with impunity. </p>
<p>1: Decent performance (no character-by-character recursive processing)</p>
<p>So the question is, can we meet these goals with JSON? I&#8217;m not sure&#8230; I&#8217;m not entirely sure how big a deal #3 is, too. I <em>feel</em> like it would be unacceptable to do this kind of recursion but I may be wrong.</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Robertson</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1802</link>
		<dc:creator>Bruce Robertson</dc:creator>
		<pubDate>Sat, 13 Jun 2009 04:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1802</guid>
		<description>I have been very interested in your dict scheme, and have done many variations and extensions of it on my own. It is quite a powerful idea. 

But the more I think about it, the more I conclude: we&#039;re doing pseudo-JSON. (Maybe it&#039;s JXSMOLN) Why not just use JSON? Then for instance if we throw it into a web viewer, and maybe the web viewer uses a jquery library - it all just works.</description>
		<content:encoded><![CDATA[<p>I have been very interested in your dict scheme, and have done many variations and extensions of it on my own. It is quite a powerful idea. </p>
<p>But the more I think about it, the more I conclude: we&#8217;re doing pseudo-JSON. (Maybe it&#8217;s JXSMOLN) Why not just use JSON? Then for instance if we throw it into a web viewer, and maybe the web viewer uses a jquery library &#8211; it all just works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1447</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Tue, 06 Jan 2009 17:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1447</guid>
		<description>Peter:

A lot of people tell us about that technique. I, for one, *prefer* to have my variables and parameters in separate name spaces. It prevents the possibility that a parameter passed to a script could impact its functioning in unexpected ways down the road. If I request a parameter called &quot;XYZ&quot; I know I&#039;ll get a passed parameter, and not a variable. But I can see either side of this argument.

I will say, though, that I agree that parameters are used so heavily that it should not be hard to type. That is why we use a function called &lt;code&gt;#&lt;/code&gt; to pass parameters:

&lt;pre&gt;&lt;code&gt;#(&quot;p1&quot;, 10) &amp; #(&quot;p2&quot;, &quot;boo&quot;)&lt;/code&gt;&lt;/pre&gt;

and &lt;code&gt;#P&lt;/code&gt; to fetch them:

&lt;pre&gt;&lt;code&gt;#P(&quot;p1&quot;) &amp; &quot; and &quot; &amp; #P(&quot;p2&quot;)&lt;/code&gt;&lt;/pre&gt;

It is certainly more characters to type than &lt;code&gt;$&lt;/code&gt; but still quite efficient.

Geoff</description>
		<content:encoded><![CDATA[<p>Peter:</p>
<p>A lot of people tell us about that technique. I, for one, *prefer* to have my variables and parameters in separate name spaces. It prevents the possibility that a parameter passed to a script could impact its functioning in unexpected ways down the road. If I request a parameter called &#8220;XYZ&#8221; I know I&#8217;ll get a passed parameter, and not a variable. But I can see either side of this argument.</p>
<p>I will say, though, that I agree that parameters are used so heavily that it should not be hard to type. That is why we use a function called <code>#</code> to pass parameters:</p>
<pre><code>#("p1", 10) &#038; #("p2", "boo")</code></pre>
<p>and <code>#P</code> to fetch them:</p>
<pre><code>#P("p1") &#038; " and " &#038; #P("p2")</code></pre>
<p>It is certainly more characters to type than <code>$</code> but still quite efficient.</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Gort</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1436</link>
		<dc:creator>Peter Gort</dc:creator>
		<pubDate>Tue, 06 Jan 2009 10:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1436</guid>
		<description>I started out doing multiple parameters using Shawn Flisakowski&#039;s Property Lists implementation.
http://www.spf-15.com/fmExamples/
Then I got sick of calling getProperty(propertylist ; propertyname) all the time:  if I have a property of the form &quot;surname=Smith&quot;, then I can feed that to another custom function I called PropertyListsToLocalVariables(propertylist), and I get a local variable called $surname with the value &quot;Smith&quot; in it.  The custom function actually calls a worker function recursively for each value supplied in the propertyList, so it doesn&#039;t matter how many or how few parameters I get, they get turned into local script variables with one custom function call.  One of these days i really should post them up to one of the custom function websites.....
To make matters more interesting, I had to retrofit the custom functions to our 89 file solution, so I wrote an AppleScript that went through all the files typing them in for me.  Let me know at pgort@denbigh.com.au if you want a copy of the custom functions/robot for typing them in.</description>
		<content:encoded><![CDATA[<p>I started out doing multiple parameters using Shawn Flisakowski&#8217;s Property Lists implementation.<br />
<a href="http://www.spf-15.com/fmExamples/" rel="nofollow">http://www.spf-15.com/fmExamples/</a><br />
Then I got sick of calling getProperty(propertylist ; propertyname) all the time:  if I have a property of the form &#8220;surname=Smith&#8221;, then I can feed that to another custom function I called PropertyListsToLocalVariables(propertylist), and I get a local variable called $surname with the value &#8220;Smith&#8221; in it.  The custom function actually calls a worker function recursively for each value supplied in the propertyList, so it doesn&#8217;t matter how many or how few parameters I get, they get turned into local script variables with one custom function call.  One of these days i really should post them up to one of the custom function websites&#8230;..<br />
To make matters more interesting, I had to retrofit the custom functions to our 89 file solution, so I wrote an AppleScript that went through all the files typing them in for me.  Let me know at <a href="mailto:pgort@denbigh.com.au">pgort@denbigh.com.au</a> if you want a copy of the custom functions/robot for typing them in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Menno van Beek</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1394</link>
		<dc:creator>Menno van Beek</dc:creator>
		<pubDate>Tue, 16 Dec 2008 00:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1394</guid>
		<description>Edited version:

Hi Everyone,

we have several systems (a few hundred fm-systems, which date back (partially) to 1992 with more than 70 fm-files). Using a custom-function is in such cases not an option and the amount of custom-builds is so much that rebuilding isn’t an option either.
With that in mind my collegaes and i use a different method, which is pretty easy to implement:

We call our script with either a script or a button with a scriptparameter which consists of multiple values:
[code]
“$value1=&quot;&amp;quote(value_x)&amp;”;$value2=&quot;quote(value_y)&amp;etc.etc.
[/code]
The script that is called has a step that sets a variable $result with the following calculation:
[code]
Evaluate( “Let( [” &amp; Get( ScriptParameter ) &amp; “]; ” &amp; 1 &amp; ” )”) 
[/code]
The nice thing is that this step creates local (or global if you like with $$) variables that you can use in the script.

Putting the “quote()” around the values ensures that the evaluate also works when one of the vars is empty. Using the quote() makes the function be read a little eassier than with escaped “\”&quot; quotes (this of coarse is a matter of opinion  )

The downside of this method may be that all the vars are evaluated as text .. in such cases you will have to change them back to numbers, dates, or wathever you need them to be. If you are sure a value is never empty you can of coarse parse it without the quotes, a date or a number will not need to be reformatted as text then.

If you were to use this function is several cascading script you could exit a script with in the ScriptResult:
[code]
Get ( ScriptParamer )&amp;”;$value5=&quot;quote(value_z)&amp;etc.etc. 
[/code]
and if one of the original values changes in this script, you could simply add that value again to the parameter …. when evaluating the last (identical named) value in the parameter will be the resultvariable  

cheers, Menno</description>
		<content:encoded><![CDATA[<p>Edited version:</p>
<p>Hi Everyone,</p>
<p>we have several systems (a few hundred fm-systems, which date back (partially) to 1992 with more than 70 fm-files). Using a custom-function is in such cases not an option and the amount of custom-builds is so much that rebuilding isn’t an option either.<br />
With that in mind my collegaes and i use a different method, which is pretty easy to implement:</p>
<p>We call our script with either a script or a button with a scriptparameter which consists of multiple values:<br />
[code]<br />
“$value1="&amp;quote(value_x)&amp;”;$value2="quote(value_y)&amp;etc.etc.<br />
[/code]<br />
The script that is called has a step that sets a variable $result with the following calculation:<br />
[code]<br />
Evaluate( “Let( [” &amp; Get( ScriptParameter ) &amp; “]; ” &amp; 1 &amp; ” )”)<br />
[/code]<br />
The nice thing is that this step creates local (or global if you like with $$) variables that you can use in the script.</p>
<p>Putting the “quote()” around the values ensures that the evaluate also works when one of the vars is empty. Using the quote() makes the function be read a little eassier than with escaped “\”&#8221; quotes (this of coarse is a matter of opinion  )</p>
<p>The downside of this method may be that all the vars are evaluated as text .. in such cases you will have to change them back to numbers, dates, or wathever you need them to be. If you are sure a value is never empty you can of coarse parse it without the quotes, a date or a number will not need to be reformatted as text then.</p>
<p>If you were to use this function is several cascading script you could exit a script with in the ScriptResult:<br />
[code]<br />
Get ( ScriptParamer )&amp;”;$value5="quote(value_z)&amp;etc.etc.<br />
[/code]<br />
and if one of the original values changes in this script, you could simply add that value again to the parameter …. when evaluating the last (identical named) value in the parameter will be the resultvariable  </p>
<p>cheers, Menno</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Menno van Beek</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1393</link>
		<dc:creator>Menno van Beek</dc:creator>
		<pubDate>Mon, 15 Dec 2008 23:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1393</guid>
		<description>Hi Everyone,

we have several systems (a few hundred fm-systems, which date back (partially) to 1992 with more than 70 fm-files). Using a custom-function is in such cases not an option and the amount of custom-builds is so much that rebuilding isn&#039;t an option either.
With that in mind my collegaes and i use a different method, which is pretty easy to implement:

We call our script with either a script or a button with a scriptparameter which consists of multiple values:

&quot;$value1=&amp;quote(value_x)&amp;&quot;;$value2=quote(value_y)&amp;etc.etc.

The script that is called has a step that sets a variable $result with the following calculation:

Evaluate( &quot;Let( [&quot; &amp; Get( ScriptParameter ) &amp; &quot;]; &quot; &amp; 1 &amp; &quot; )&quot;) 

The nice thing is that this step creates local (or global if you like with $$) variables that you can use in the script.

Putting the &quot;quote()&quot; around the values ensures that the evaluate also works when one of the vars is empty. Using the quote() makes the function be read a little eassier than with escaped &quot;\&quot;&quot; quotes (this of coarse is a matter of opinion ;) )

The downside of this method may be that all the vars are evaluated as text .. in such cases you will have to change them back to numbers, dates, or wathever you need them to be. If you are sure a value is never empty you can of coarse parse it without the quotes, a date or a number will not need to be reformatted as text then.

If you were to use this function is several cascading script you could exit a script with in the ScriptResult:
Get ( ScriptParamer )&amp;&quot;;$value5=quote(value_z)&amp;etc.etc. and if one of the original values changes in this script, you could simply add that value again to the parameter .... when evaluating the last (identical named) value in the parameter will be the resultvariable ;)

cheers, Menno</description>
		<content:encoded><![CDATA[<p>Hi Everyone,</p>
<p>we have several systems (a few hundred fm-systems, which date back (partially) to 1992 with more than 70 fm-files). Using a custom-function is in such cases not an option and the amount of custom-builds is so much that rebuilding isn&#8217;t an option either.<br />
With that in mind my collegaes and i use a different method, which is pretty easy to implement:</p>
<p>We call our script with either a script or a button with a scriptparameter which consists of multiple values:</p>
<p>&#8220;$value1=&amp;quote(value_x)&amp;&#8221;;$value2=quote(value_y)&amp;etc.etc.</p>
<p>The script that is called has a step that sets a variable $result with the following calculation:</p>
<p>Evaluate( &#8220;Let( [" &amp; Get( ScriptParameter ) &amp; "]; &#8221; &amp; 1 &amp; &#8221; )&#8221;) </p>
<p>The nice thing is that this step creates local (or global if you like with $$) variables that you can use in the script.</p>
<p>Putting the &#8220;quote()&#8221; around the values ensures that the evaluate also works when one of the vars is empty. Using the quote() makes the function be read a little eassier than with escaped &#8220;\&#8221;" quotes (this of coarse is a matter of opinion <img src='http://sixfriedrice.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>The downside of this method may be that all the vars are evaluated as text .. in such cases you will have to change them back to numbers, dates, or wathever you need them to be. If you are sure a value is never empty you can of coarse parse it without the quotes, a date or a number will not need to be reformatted as text then.</p>
<p>If you were to use this function is several cascading script you could exit a script with in the ScriptResult:<br />
Get ( ScriptParamer )&amp;&#8221;;$value5=quote(value_z)&amp;etc.etc. and if one of the original values changes in this script, you could simply add that value again to the parameter &#8230;. when evaluating the last (identical named) value in the parameter will be the resultvariable <img src='http://sixfriedrice.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>cheers, Menno</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/comment-page-1/#comment-1240</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Mon, 07 Jul 2008 16:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/#comment-1240</guid>
		<description>@Brian:

Thanks for the heads up. Alas, the cleanup process isn&#039;t as simple as one would hope. Wordpress seems to have incorrectly interpreted UTF-8 data as Latin-1, then re-transcoded it to UTF-8. This happened with our last upgrade (using their built in import/export functions). The end result is we have valid UTF-8 content, properly encoded and displayed, which contains wacky characters.

Fixing it requires correcting each problem case. Some day I&#039;ll get a script written to do this for me.

Thanks,

Geoff</description>
		<content:encoded><![CDATA[<p>@Brian:</p>
<p>Thanks for the heads up. Alas, the cleanup process isn&#8217;t as simple as one would hope. Wordpress seems to have incorrectly interpreted UTF-8 data as Latin-1, then re-transcoded it to UTF-8. This happened with our last upgrade (using their built in import/export functions). The end result is we have valid UTF-8 content, properly encoded and displayed, which contains wacky characters.</p>
<p>Fixing it requires correcting each problem case. Some day I&#8217;ll get a script written to do this for me.</p>
<p>Thanks,</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
</channel>
</rss>

