<doc>
  <legacy_id>2238</legacy_id>
  <name>[]</name>
  <type>keyword</type>
  <syntax>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Values &amp; Properties</category>
  </classification>
  <references>
    <command tag="split">split Command</command>
    <function tag="arrayEncode">arrayEncode Function</function>
    <operator tag="()">() Operator</operator>
  </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>The square bracket characters <b>[ ]</b> surround the <keyword tag="element">element</keyword> name in an <glossary tag="array">array</glossary> reference.</summary>
  <examples>
    <example>put thisValue into myArray["someKey"]</example>
    <example>if myArray["someOtherKey"] is "A" then beep</example>
  </examples>
  <description>
    <p>Use square brackets <b>[ ]</b> to specify which <keyword tag="element">element</keyword> in an <glossary tag="array">array</glossary> you are referring to.</p><p/><p><b>Comments:</b></p><p>You access an element of an array by using the name of the array, along with the key in square brackets:</p><p/><p>  put "A" into myList["firstLetter"]</p><p>  put "B" into myList["secondLetter"]</p><p>  put "C" into myList["thirdLetter"]</p><p>  get myList["secondLetter"] <i>-- yields "B"</i></p><p/><p>Square brackets must be used in pairs, each <b>[</b> with a matching <b>]</b>. Using a single square bracket does not cause an <glossary tag="error">error</glossary>, but the bracket is interpreted as part of the <glossary tag="variable">variable</glossary> name, rather than as the marker for the <glossary tag="key">key</glossary> of an <glossary tag="array">array</glossary> reference.</p><p/><p><b>Note:</b> Arrays in LiveCode are <i>associative </i>(also known as<i> hash tables</i>). This means that when an array element is accessed using square bracket notation, the value in between the brackets is used to "look up" the element, and is not a numeric index as in C, Pascal and other languages. Of course it is still possible to use numbers as array keys, but LiveCode internally converts these to strings before retrieving the array elements.</p>
  </description>
</doc>