AscA

Description

Converts the first character of a string to its ASCII integer value.

Syntax

AscA ( string )

Argument

Description

string

The string for which you want the ASCII value of the first character

Returns

Integer. Returns the ASCII value of the first character in string.

Usage

Use AscA to test the case of a character or manipulate text and letters.

To find out the case of a character, you can check whether its ASCII value is within the appropriate range.

Examples

Example 1

This expression for a computed field returns the string in code_id if the ASCII value of the first character in code_id is A (65):

If (AscA(code_id) = 65, code_id, "Not a valid code")

Example 2

This expression for a computed field checks the case of the first character of lname and if it is lowercase, makes it uppercase:

IF (AscA(lname) > 64 AND AscA(lname) < 91, lname, WordCap(lname))

See also