Previous Topic: BOOLEAN Function--Convert to "TRUE" or "FALSE"

Next Topic: CENTER Function--Pad a Source String

CHAR Function--Convert an ASCII Value

The CHAR function converts the specified ASCII value to a one-character string.

Syntax

The CHAR function has the following format:

CHaR(ASCII_value)

Parameters

The CHAR function accepts the following parameter:

ASCII_value (number)

Specifies the ASCII value. If the ASCII_value is zero, the function returns an empty string. If the ASCII_value is greater than 255, the function converts the modulus 256 of the ASCII_value to a one-character string.

Note: Performing a modulus 256 on a value is equivalent to performing a bitwise AND with 255.

Return Value

The CHAR function returns a one-character string.

Example

Return_value=CHAR(0)
Return_value=''

Return_value=CHAR(36)
Return_value='$'

Return_value=CHAR(299)
Return_value='+'


Copyright © 2010 CA. All rights reserved. Email CA about this topic