Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

ALPHA

Determines if a string is alphabetic or not.

Synopsis

ALPHA(string)

Arguments

string An expression that resolves to a string.

Description

If string consists entirely of alphabetic characters, ALPHA returns 1. Otherwise, ALPHA returns 0. Note that blank spaces are non-alphabetic characters. Dynamic array separator characters are considered to be alphabetic characters. On a Unicode system ALPHA recognizes Unicode letters as alphabetic characters.

Examples

The following example uses the ALPHA function to determine if a string consists of only alphabetic characters:

PRINT ALPHA("abcdefg");    ! Returns 1
PRINT ALPHA("AbCdEfG");    ! Returns 1
PRINT ALPHA("my string");  ! Returns 0 (space not allowed)
PRINT ALPHA("half-wit");   ! Returns 0 (hyphen not allowed)
PRINT ALPHA("");           ! Returns 0
PRINT ALPHA(123);          ! Returns 0
Copy code to clipboard

See Also