[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Convert an ASCII code to a character value

     CHR(<nCode>) --> cChar


     <nCode> is an ASCII code in the range of zero to 255.


     CHR() returns a single character value whose ASCII code is specified by


     CHR() is a numeric conversion function that converts an ASCII code to a
     character.  It is the inverse of ASC().  CHR() serves a number of common
     tasks including:

     .  Sending control codes and graphics characters to the screen or

     .  Ringing the bell

     .  Converting INKEY() return values to characters

     .  Stuffing the keyboard buffer


     .  The null character: CHR(0) has a length of one (1) and is
        treated like any other character.  This lets you send it to any
        device or file, including a database file.


     .  These examples illustrate CHR() with various arguments:

        ? CHR(72)                    // Result: H
        ? CHR(ASC("A") + 32)         // Result: a
        ? CHR(7)                     // Result: bell sounds

     .  These lines of code show the difference between a null string
        and the null character:

        ? LEN("")                   // Result: 0
        ? LEN(CHR(0))               // Result: 1

 Files   Library is CLIPPER.LIB.

See Also: ASC() INKEY()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson