<doc>
  <legacy_id>1865</legacy_id>
  <name>params</name>
  <type>function</type>
  <syntax>
    <example>the params</example>
    <example>params()</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
    <category>Values &amp; Properties</category>
  </classification>
  <references>
    <command tag="call">call Command</command>
    <function tag="paramCount">paramCount Function</function>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
    <changed version="2.0"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> all the <glossary tag="parameter">parameters</glossary> <glossary tag="pass">passed</glossary> to the current <glossary tag="handler">handler</glossary>.</summary>
  <examples>
    <example>the params</example>
    <example>put char 2 to -2 of word 1 of the params into handlerName</example>
  </examples>
  <description>
    <p>Use the <b>params</b> <control_st tag="function">function</control_st> within a <glossary tag="handler">handler</glossary> to get the <glossary tag="parameter">parameters</glossary> that were <glossary tag="pass">passed</glossary> to the <glossary tag="handler">handler</glossary>.</p><p/><p><b>Value:</b></p><p>When used in a message handler, the <b>params</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <glossary tag="handler">handler</glossary> name, a space, and a list of <glossary tag="parameter">parameter</glossary> <glossary tag="value">values</glossary>, each enclosed in quotes and separated by commas.</p><p/><p>When used in a function handler, the <b>params</b> <control_st tag="function">function</control_st> returns the <glossary tag="handler">handler</glossary> name, then the list of <glossary tag="parameter">parameter</glossary> <glossary tag="value">values</glossary> in parentheses. Each parameter value is enclosed in quotes and separated by commas.</p><p/><p><b>Comments:</b></p><p>Usually, you assign names to parameters in the first line of a function handler or message handler. For example, the following handler assigns three parameters:</p><p/><p><code>  on myHandler thisParam,thatParam,theOtherParam</code></p><p><code>    answer thisParam &amp; return &amp; thatParam &amp; return &amp; theOtherParam</code></p><p><code>  end myHandler</code></p><p/><p>If you call the above handler with four parameters, the first three parameters are assigned to the names<code> thisParam</code>,<code> thatParam</code>, and<code> theOtherParam</code>, but the fourth parameter is not assigned a name:</p><p/><p><code>  myHandler "red","green","blue","yellow"</code></p><p/><p>You can obtain the fourth parameter for use in the handler with the <b>params</b> <control_st tag="function">function</control_st>:</p><p/><p><code>  on myHandler thisParam,thatParam,theOtherParam</code></p><p><code>    put item 4 of the params into yetAnotherParam</code></p><p><code>    answer yetAnotherParam</code></p><p><code>  end myHandler</code></p><p/><p>In this case, item 4 of the <b>params</b> is<code> "yellow"</code>. (To use the value itself, you need to remove the opening and closing quotes.)</p><p/><p>If the <b>params</b> <control_st tag="function">function</control_st> is used in a <glossary tag="function handler">function handler</glossary>, the parameters are enclosed in parentheses. For example, the following function handler has three parameters:</p><p/><p><code>  function myFunction thisParam,thatParam,theOtherParam</code></p><p><code>    return thisParam &amp; return &amp; thatParam &amp; return &amp; theOtherParam</code></p><p><code>  end myFunction</code></p><p/><p>If you call "myFunction" with the following statement:</p><p><code/>  get myFunction("red","green","blue")</p><p>the value returned is "myFunction("red","green","blue")".</p><p/><p>LiveCode evaluates the parameters before passing them. So if you call<code> myHandler </code>with the following statement:</p><p><code>  myHandler 1+1,"A","Hello" &amp;&amp; "world"</code></p><p>the value returned by the <b>params</b> <control_st tag="function">function</control_st> is</p><p><code>  myHandler "2","A","Hello world"</code></p><p/><p><b>Changes:</b></p><p>The format of the <b>params</b> when used in a <glossary tag="function handler">function handler</glossary> was changed in version 2.0. In previous versions, the format for functions was the same as the format for <glossary tag="message handler">message handlers</glossary>:  the <glossary tag="parameter">parameters</glossary> were not enclosed in parentheses, but instead separated from the <glossary tag="handler">handler</glossary> name by a space.</p>
  </description>
</doc>