Difference between revisions of "Chr"

m (adding doc status category stub page)
(Copied user guide content, changed status.)
Line 1: Line 1:
 
[[category:Text Functions]]
 
[[category:Text Functions]]
[[Category:Doc Status D]] <!-- For Lumina use, do not change -->
+
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
{{stub}}
+
= Chr(n) =
 +
 
 +
Returns the character corresponding to the numerical ASCII code ''n'' (a number between 0 and 255). Chr and [[Asc]] are inverses of each other, for example:
 +
:Chr(65) &rarr; ‘A’, [[Asc]](Chr(65)) &rarr; 65
 +
:[[Asc]](‘A’) &rarr; 65, Chr([[Asc]](‘A’)) &rarr; ‘A’
 +
Chr is useful for creating characters that cannot easily be typed, such as tab, which is Chr(9) and carriage return (CR), which is Chr(13). For example, if you [[ReadTextFile|read in a text file]], x, you can use [[SplitText]](x, Chr(13)) to generate an array of lines from the text.
 +
 
 +
= Note =
 +
 
 +
The mapping for characters from 128 to 255 is subject to your system's language/region-specific character map.  Analytica 4.0 has adopted a Windows mapping, while Analytica 3.1 and earlier used a Macintosh standard mapping, see [[Asc]].
 +
 
 +
= Library =
 +
 
 +
Text functions
 +
 
 +
= See Also =
 +
 
 +
* [[Asc]]
 +
* [[SplitText]]

Revision as of 21:39, 10 July 2007


Chr(n)

Returns the character corresponding to the numerical ASCII code n (a number between 0 and 255). Chr and Asc are inverses of each other, for example:

Chr(65) → ‘A’, Asc(Chr(65)) → 65
Asc(‘A’) → 65, Chr(Asc(‘A’)) → ‘A’

Chr is useful for creating characters that cannot easily be typed, such as tab, which is Chr(9) and carriage return (CR), which is Chr(13). For example, if you read in a text file, x, you can use SplitText(x, Chr(13)) to generate an array of lines from the text.

Note

The mapping for characters from 128 to 255 is subject to your system's language/region-specific character map. Analytica 4.0 has adopted a Windows mapping, while Analytica 3.1 and earlier used a Macintosh standard mapping, see Asc.

Library

Text functions

See Also

Comments


You are not allowed to post comments.