<doc>
  <legacy_id>2150</legacy_id>
  <name>revXMLRPC_AddParam</name>
  <type>command</type>
  <syntax>
    <example>revXMLRPC_AddParam <i>XML-RPC document</i>,<i>type</i>,<i>value</i></example>
  </syntax>
  <library>XML-RPC library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Networks &amp; Communication</category>
  </classification>
  <references>
    <function tag="revXMLRPC_GetParam">revXMLRPC_GetParam Function</function>
    <function tag="revXMLRPC_GetParamType">revXMLRPC_GetParamType Function</function>
    <function tag="revXMLRPC_GetParamCount">revXMLRPC_GetParamCount Function</function>
  </references>
  <history>
    <introduced version="2.5">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <disk access="???"/>
    <process/>
  </security>
  <summary>Adds a single parameter to an XML-RPC document structure.</summary>
  <examples>
    <example>revXMLRPC_AddParam theRequest, "int", 55</example>
    <example>revXMLRPC_AddParam theRequest, "base64", base64Encode(theBinaryData)</example>
  </examples>
  <description>
    <p>Use the <b>revXMLRPC_AddParam</b> <glossary tag="command">command</glossary> to add a single parameter of a given type to an existing <glossary tag="XML-RPC document">XML-RPC document</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>documentID</i> is the number <glossary tag="return">returned</glossary> by the <function tag="revXMLRPC_CreateRequest">revXMLRPC_CreateRequest</function> when you created the <glossary tag="XML-RPC document">XML-RPC request</glossary>.</p><p/><p>The <i>type</i> is the type of data contained in the <i>value</i> parameter.</p><p>The supported types are:</p><p>	* <b>base64</b>: the value is base64-encoded</p><p>	* <b>boolean</b>: the value is true or false</p><p>	* <b>dateTime.iso8601</b>: the value is an Internet date</p><p>	* <b>double</b>: the value is a floating-point number</p><p>	* <b>int</b> or <b>i4</b>: the value is an <glossary tag="integer">integer</glossary> number</p><p>	* <b>string</b>: the value is a string of characters</p><p>	* <b>array</b>: the value is an array of data (see below)</p><p>	* <b>xml</b>: the value is data in xml-format (see below)</p><p/><p>The <i>value</i> is the content of the data you want to add as a new parameter.</p><p/><p><b>Comments:</b></p><p>To pass an array of data, you have to pass the type as well, in the following format:</p><p>	* <b>array[:element type]</b></p><p/><p>Example:</p><p><code>local theArray</code></p><p><code>repeat with i = 1 to 10</code></p><p><code>  put random(100) into theArray[i]</code></p><p><code>end repeat</code></p><p><code>revXMLRPC_AddParam theDocID, "array:int", theArray</code></p><p/><p>If you do not specify an element type, the <b>revXMLRPC_AddParam</b> <glossary tag="command">command</glossary> assumes you're passing an array of strings.</p><p/><p>If you need to add complex parameters (such as arrays of various types, or structs) you can specify a type of xml, and pass raw xml.</p><p/><p>Example :</p><p><code>put "&lt;struct&gt;" &amp; \</code></p><p><code>    "&lt;member&gt;&lt;name&gt;left&lt;/name&gt;" &amp; \</code></p><p><code>    "&lt;value&gt;&lt;int&gt;10&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" &amp; \</code></p><p><code>    "&lt;member&gt;&lt;name&gt;top&lt;/name&gt;" &amp; \</code></p><p><code>    "&lt;value&gt;&lt;int&gt;50&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" &amp; \</code></p><p><code>    "&lt;member&gt;&lt;name&gt;right&lt;/name&gt;" &amp; \</code></p><p><code>    "&lt;value&gt;&lt;int&gt;390&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" &amp; \</code></p><p><code>    "&lt;member&gt;&lt;name&gt;bottom&lt;/name&gt;" &amp; \</code></p><p><code>    "&lt;value&gt;&lt;int&gt;240&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" &amp; \</code></p><p><code>    "&lt;/struct&gt;" into theStruct</code></p><p><code>revXMLRPC_AddParam theDocID, "xml", theStruct</code></p><p/><p>If the <b>revXMLRPC_AddParam</b> <glossary tag="command">command</glossary> encounters an error, the <function tag="result">result</function> is set to an error message beginning with "xmlerr" or "xmlrpcerr".</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>revXMLRPC_AddParam</b> <glossary tag="command">command</glossary> is part of the <glossary tag="XML-RPC library">XML-RPC library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section on the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "XML-RPC Library" is selected in the list of script libraries.</p>
  </description>
</doc>