<doc>
	<legacy_id>1524</legacy_id>
	<name>keys</name>
	<type>function</type>

	<syntax>
		<example>the keys of <i>arrayName</i></example>
		<example>keys(<i>arrayName</i>)</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Returns a list of the <keyword tag="element">element</keyword> names in an <glossary tag="array">array variable</glossary>. </summary>

	<examples>
<example>the keys of myArray</example>
<example>repeat with thisItem = 1 to the number of lines in the keys of it</example>
<example><p>repeat for each line tKey in the keys of tArray</p><p>  put tArray[tKey] &amp; return after tArrayContents</p><p>end repeat</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added. </introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Values &amp; Properties</category>
	</classification>

	<references>
		<function tag="transpose">transpose Function</function>
		<function tag="arrayEncode">arrayEncode Function</function>
		<function tag="extents">extents Function</function>
		<command tag="combine">combine Command</command>
		<command tag="split">split Command</command>
		<property tag="properties">properties Property</property>
		<operator tag="is among the keys of">is among the keys of Operator</operator>
	</references>

	<description>
	<overview>Use the <b>keys</b> function to manage the elements of an <glossary tag="array">array</glossary>, or to perform some action on each <keyword tag="element">element</keyword> in an <glossary tag="array">array</glossary>. </overview>

	<parameters>
  <parameter>The <i>arrayName</i> is the name of a <glossary tag="variable">variable</glossary>.</parameter>
  </parameters>

	<value>The <b>keys</b> <control_st tag="function">function</control_st> returns a list of <function tag="keys">keys</function>, one per <keyword tag="line">line</keyword>.<p></p><p></p><note> The order of the <function tag="keys">keys</function> is not alphabetical or chronological; it is based on the internal order.  To obtain an alphabetical list of <function tag="keys">keys</function>, use the <command tag="sort">sort command</command>:</note><p></p><p>  put the keys of myArray into myVariable</p><p>  sort lines of myVariable</p><p></p><p></p><note> Arrays in LiveCode are <i>associative</i> (also known as<i> hash tables</i>). This means that the keys of an array are strings which LiveCode uses to &quot;look up&quot; the array elements rather than numeric indices as in C, Pascal and other languages. Of course it is possible to use numeric values for array keys, but LiveCode will internally convert these into strings before retrieving the array elements</note></value>
	<comments></comments>
	</description>
</doc>