forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcharToNum.xml
More file actions
59 lines (59 loc) · 4.65 KB
/
Copy pathcharToNum.xml
File metadata and controls
59 lines (59 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<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>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<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>
<history>
<introduced version="1.0">Added.</introduced>
<changed version="2.0"></changed>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
<mobile/>
</classes>
<security>
</security>
<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") <code><i>-- returns 65</i></code></example>
<example>charToNum("ABC") <code><i>-- also returns 65</i></code></example>
<example>if charToNum(nextChar) = 0 then next repeat</example>
<example>numToChar(charToNum("Z")) <code><i>-- returns Z</i></code></example>
</examples>
<description>
<p>Use the <b>charToNum</b> function to rank characters in their <glossary tag="numeric">numerical</glossary> order.</p><p/><p><b>Parameters:</b></p><p>The <i>character</i> is any <keyword tag="character">character</keyword> or <glossary tag="expression">expression</glossary> that evaluates to a <keyword tag="character">character</keyword>. If you specify a <keyword tag="string">string</keyword> containing more than one <keyword tag="character">character</keyword>, all <keyword tag="characters">characters</keyword> but the first are ignored.</p><p/><p><b>Value:</b></p><p>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.</p><p/><p><b>Comments:</b></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>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>If the <b>useUnicode</b> <glossary tag="property">property</glossary> is set to true, you can specify a <href tag="../glossary/doubledashbyte_character.xml">double-byte</href> <i>character</i>. If the <property tag="useUnicode">useUnicode</property> is false and you specify a <href tag="../glossary/doubledashbyte_character.xml">double-byte character</href>, 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><b>Changes:</b></p><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>.</p>
</description>
</doc>