ISALPHA Function

Returns a true value if the expression is a string made up entirely of alphabetic characters.

Category: Information and Conversion
Returned data type: Integer
Note: The returned value is a Boolean value, true if the "in_string" contains only alpha characters. Otherwise, the value is false.

Syntax

ISALPHA (<in_string>)

Required Argument

in string

a string of characters to be searched for any alphabetic characters

Details

The isalpha function returns true if "in_string" is determined to be a string containing only alpha characters.

Examples

Example 1

// Expression

string letters

letters="lmnop"

string mixed

mixed="1a2b3c"

 

string alphatype

alphatype=isalpha(letters) // returns true

string mixedtype

mixedtype=isalpha(mixed) // returns false

Example 2

string all_Alpha

all_Alpha="abcdefghijklmnoprstuvyz"

 

string non_Alpha

non_Alpha="%&)#@*0123456789"

 

string error_message1

string error_message2

 

if (NOT isalpha(all_Alpha))

  error_message1 ="all_Alpha string contains alpha numeric characters"

else

   error_message1 ="all_Alpha string contains alpha numeric characters"

 

if(isalpha(non_Alpha))

  error_message2= "non_Alpha string contains alpha numeric characters"

else

   error_message2= "non_Alpha string does not contain alpha numeric characters"

Example 3

string all_Alpha

string error_message

all_Alpha="abcdefghijklmnopqrstuvwxyz"

if (isalpha(all_Alpha))

   begin

        error_message= "alpha strings were identified as alpha"

   end