char

Syntax char (value)

Params value is the object whose datatype you wish to coerce to be a character.

Action Coerces the datatype of value to be char if possible.

Returns A character value.

Examples char (65)

   » 'A'

65 is the ASCII equivalent for "A."

char ('a')

   » 'a'

No coercion is necessary; value is already of the right datatype.

for i=33 to 255 {msg (char (i))}

   » true

Cycles through all ASCII characters from 33 to 255 in the Main Window message area and returns true.

char ("A")

   » 'A'

A one-character string is coerced to a character.

Errors If value is a string of two or more characters or other value that can't be coerced to a number in the ASCII range of 0-255, an error will be generated.

Discuss