CHR (Character)

The CHR string function returns a character in the extended ASCII character set.

Syntax

CHR ( Code )

Remarks

The CHR function returns a string consisting of the character indicated followed by a null character. CHR(0) will produce a string of two nulls. The character returned by the CHR function can be stored in a string in the program or sent to some other device by using serial commands (for example, SerialOut).

NOTE: Characters up to 127 represent the standard ASCII character set and will mostly likely work correctly in any application. Characters beyond 127 are dependent on the application using the created string.

Parameter

Code

The code for the character to be output. The Code parameter is the integer value (0 through 255) that is the extended ASCII representation of the character to output. See ASCII Codes and Characters for a full list of codes and their associated characters.

Type: Integer, 0 to 255

String variables can be declared as only one or two dimensions; for example, String(x) or String(x,y). To begin reading or modifying a string at a particular location into the string, enter the location as a third dimension; for example, String(x,y,n) where n is the desired character. For example, given an array of strings Str(10,10), Str(2,2,n) refers to n character in the (2,2) element of the array. Use Str(1,1,n) for a scalar variable and Str(x,1,n) for a one dimensional array element.