CharA

Description

Extracts the first ASCII character of a string or converts an integer to a char.

Syntax

CharA ( n )

Argument

Description

n

A string that begins with the character you want, an integer you want to convert to a character, or a blob in which the first value is a string or integer. The rest of the contents of the string or blob is ignored. N can also be an Any variable containing a string, integer, or blob.


Return value

Char.

Returns the first character of n. If n is null, CharA returns null.

Examples

This example sets ls_S to an asterisk, the character corresponding to the ASCII value 42:

string ls_S
ls_S = CharA(42)

These statements generate delivery codes A to F for the values 1 through 6 of li_DeliveryNbr:

string ls_Delivery
integer li_DeliveryNbr
 
FOR li_DeliveryNbr = 1 to 6
    ls_Delivery = CharA(64 + li_DeliveryNbr)
    ... // Additional processing of ls_Delivery
NEXT

See also

AscA

Char

Char method for DataWindows in the section called “Char” in DataWindow Reference.