<doc>
	<legacy_id>1151</legacy_id>
	<name>charToNum</name>
	<type>function</type>

	<syntax>
		<example>the charToNum of <i>character</i></example>
		<example>charToNum(<i>character</i>)</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary><glossary tag="return">Returns</glossary> the <glossary tag="ASCII">ASCII value</glossary> of a <keyword tag="character">character</keyword>.</summary>

	<examples>
<example>charToNum("A") </example>
<example>charToNum("ABC") </example>
<example><p>if charToNum(nextChar) = 0 then next repeat</p></example>
<example>numToChar(charToNum("Z")) </example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="7.0">7.0</changed>
<changed version="2.0">2.0</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

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

	<security>
	</security>


	<classification>
		<category>Text and Data Processing</category>
	</classification>

	<references>
		<function tag="numToChar">numToChar Function</function>
		<function tag="mouseCharChunk">mouseCharChunk Function</function>
		<function tag="uniDecode">uniDecode Function</function>
		<function tag="URLDecode">URLDecode Function</function>
		<function tag="clickChar">clickChar Function</function>
		<function tag="format">format Function</function>
		<function tag="md5Digest">md5Digest Function</function>
		<property tag="HTMLText">HTMLText Property</property>
		<property tag="extendKey">extendKey Property</property>
		<property tag="unicodeText">unicodeText Property</property>
		<property tag="RTFText">RTFText Property</property>
	</references>

	<description>
	<overview>Use the <b>charToNum</b> function to rank characters in their <glossary tag="numeric">numerical</glossary> order.</overview>

		<parameters>
  <parameter>
    <name>character</name>
    <description>The character is any character or expression that evaluates to a character. If you specify a string containing more than one character, all characters but the first are ignored.</description>
  </parameter>		</parameters>

	<value>The <b>charToNum</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword> between zero and 255. If the <property tag="useUnicode">useUnicode</property> <glossary tag="property">property</glossary> is set to true, the <b>charToNum</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword> between zero and 65535.</value>
	<comments><important><p>As of version 7.0 the numToChar and charToNum functions have been deprecated. They will continue to work as in previous versions but should not be used with Unicode text as unexpected results may occur. If working with Unicode text use the <function tag="numToCodepoint">numToCodepoint</function> and <function tag="codepointToNum">codepointToNum</function> functions, for native text use <function tag="numToNativeChar">numToNativeChar</function> and <function tag="nativeCharToNum">nativeCharToNum</function> functions. If working with binary data use the <function tag="numToByte">numToByte</function> and <function tag="byteToNum">byteToNum</function> functions.</important><p></p><p>The <b>charToNum</b> <control_st tag="function">function</control_st> is the <keyword tag="inverse">inverse</keyword> of the <function tag="numToChar">numToChar</function> <control_st tag="function">function</control_st>.</p><p></p><p>For special characters (those typed using the Option key or Alt key), the value returned by the <b>charToNum</b> <control_st tag="function">function</control_st> depends on the <glossary tag="character set">character set</glossary> currently in use. On <glossary tag="Mac OS">Mac OS systems</glossary> this is normally the <glossary tag="Mac OS">Macintosh</glossary> <glossary tag="character set">character set</glossary>; on <glossary tag="Unix">Unix systems</glossary>, this is normally <glossary tag="ISO 8859">ISO 8859</glossary>; on <glossary tag="Windows">Windows systems</glossary>, this is usually Code Page 1252, a variant of <glossary tag="ISO 8859">ISO 8859</glossary>.</p><p></p><p>If the <b>useUnicode</b> <glossary tag="property">property</glossary> is set to true, you can specify a double-byte <i>character</i>. If the <property tag="useUnicode">useUnicode</property> is false and you specify a double-byte character, the <b>charToNum</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the numeric value of the <keyword tag="character">character</keyword> <operator tag="div">div</operator> 256.</p><p></p><p></p><p></p><change><p>The ability to handle Unicode characters was introduced in version 2.0. In previous versions, it was not possible to pass a Unicode character to the <b>charToNum</b> <control_st tag="function">function</control_st>.</change></comments>
	</description>
</doc>