Your IP : 216.73.216.48
# $EPIC: chr,v 1.2 2003/07/07 05:24:17 jnelson Exp $
Synopsis:
$chr(<integer list>)
Technical:
This function converts a list of integers, formatted as:
0x<num> as a hexidecimal (base 16) number
0<num> as an octal (base 8) number
<num> as a decimal (base 10) number
into a string of characters, where each integer in the list comprises
each character in the output string, in order.
<num> should be the equivalent of a decimal number between 0 and 255
inclusively. Precisely, only the 8 least signficiant bits are used in
each number; any higher bits are ignored. For negative numbers, this
means you should keep adding 256 to the number until you get a
nonnegative value.
Because your font determines what glyphs (characters) appear at each
ascii position, the return value may appear differently depending on
your current locale.
Practical:
It is not necessarily obvious that it is not necessary to encode an
entire string using $chr(). It is possible to insert only one
character, and it is very handy in places where inserting a control
character would be a hassle. For example, $chr(3) inserts a ^C which
is the color-shift control character.
Returns:
chr: concatenated list of characters.
Examples:
/* assume iso8859-1 character set */
$chr(1 2 3) returns "ABC" (ctrl-A, -B, -C)
$chr(3)4Hey! returns "Hey!" in red
$chr($ascii(abcABC)) returns "abcABC"