Char

Description

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

Syntax

Char ( 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.

Returns

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

Examples

Example 1

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

string ls_S

ls_S = Char(42)

Example 2

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 = Char(64 + li_DeliveryNbr)

    ... // Additional processing of ls_Delivery

NEXT

See also