IS.ALNUM(), IS.ALPHA(), IS.DIGIT(), IS.GRAPH(), IS.MARK(), IS.SPACE(), IS.WIDE()

IS.ALNUM(), IS.ALPHA(), IS.DIGIT(), IS.GRAPH(), IS.MARK(), IS.SPACE(), IS.WIDE()

Top  Previous  Next

 

This set of eight functions test whether a character is of a specific type.

 

 

Format

 

IS.ALNUM(char)

IS.ALPHA(char)

IS.DIGIT(char)

IS.GRAPH(char)

IS.MARK(char)

IS.SPACE(char)

IS.WIDE(char)

IS.USER.CHAR(char)

 

where

 

charis the character to be tested.

 

 

If char is more than one character, only the first character is tested. If char is a null string, the function will return False.

 

 

The character maps assign type attributes to each character. These functions allow an application to test whether a character has a particular attribute set. The functions return True if the attribute is set, False if it is not set.

 

The IS.ALNUM() function tests whether a character is defined as being either a letter or a digit.

 

The IS.ALPHA() function tests whether a character is defined as being a letter.

 

The IS.DIGIT() function tests whether a character is defined as being a digit.

 

The IS.GRAPH() function tests whether a character is defined as being a graphical (printing) character. Note that the space is not included.

 

The IS.MARK() function tests whether a character is defined as being a mark character (251- 255). The position of these in the character set and their meaning cannot be changed in user defined character maps.

 

The IS.SPACE() function tests whether a character is defined as being whitespace. Unicode defines several code points as being spaces of various types.

 

The IS.WIDE() function tests whether a character requires two display positions.

 

The IS.USER.CHAR() function tests whether a character has the user defined attribute set.

 

 

On a non-ECS mode system, the default behaviour for members of the 8-bit character set are fixed. The alphabetic characters are A-Z and a-z, the digits are 0-9, the graphical characters 33 to 126, the marks are the five mark characters and the space is only the space character. There is limited support for user defined character maps created using the EDIT.MAP command and loaded either from use of the CHARMAP configuration parameter or by use of the CHAR.MAP command.

 

 

 

Example

 

S1 = ECHAR(0x03A3)

DISPLAY IS.ALPHA(S1)

 
The above program fragment tests whether S1, which contains a single character with Unicode code point value U+03A3 (uppercase Greek Sigma), is a letter. It will display 1 (True) when using a Greek character map.

 

 

See also:

IS.WIDESTR()