<doc>
  <legacy_id>1501</legacy_id>
  <name>random</name>
  <type>function</type>
  <syntax>
    <example>the random of <i>upperLimit</i></example>
    <example>random(<i>upperLimit</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Math, Logic, &amp; Dates</category>
  </classification>
  <references>
    <keyword tag="any">any Keyword</keyword>
    <property tag="randomSeed">randomSeed Property</property>
    <function tag="round">round Function</function>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> a <function tag="random">random</function> <keyword tag="integer">integer</keyword>.</summary>
  <examples>
    <example>random(22) <code><i>-- returns a number between 1 and 22</i></code></example>
    <example>random(item 1 of field "Numbers")</example>
    <example>sort lines of myVar by random(the number of lines of myVar)</example>
  </examples>
  <description>
    <p>Use the <b>random</b> <control_st tag="function">function</control_st> to pick a <function tag="random">random</function> member of a set, or to generate a <function tag="random">random</function> number.</p><p/><p><b>Parameters:</b></p><p>The <i>upperLimit</i> is a number.</p><p/><p><b>Value:</b></p><p>The <b>random</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword>.</p><p/><p><b>Comments:</b></p><p>If the <i>upperLimit</i> is a positive <keyword tag="integer">integer</keyword>, the <b>random</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword> between 1 and the <i>upperLimit</i>. If the <i>upperLimit</i> is a number that is not an <keyword tag="integer">integer</keyword>, the <b>random</b> function <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword> between 1 and<code> round(<i>upperLimit</i>)</code>.</p><p/><p>To generate a random number between two integers, use a handler like this:</p><p/><p><code>  function randomInRange lowerLimit,upperLimit</code></p><p><code>    return random(upperLimit - lowerLimit + 1) + lowerLimit - 1</code></p><p><code>  end randomInRange</code></p>
  </description>
</doc>