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
85 lines (70 loc) · 5.1 KB
/
Copy pathcharToNum.xml
File metadata and controls
85 lines (70 loc) · 5.1 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<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>