6.3.2.2 Lexical Comparison Functions

Fortran provides four lexical comparison functions:

Lexical functions take the following form:

func (c,c)
func
Is one of the symbolic names: LGE, LGT, LLE, or LLT.
c
Is a character expression.

The lexical comparison functions defined by the FORTRAN-77 standard are guaranteed to make comparisons according to the ASCII collating sequence, even on non-ASCII processors.

In Compaq Fortran 77, the lexical comparison functions are identical to the corresponding character relationals.

Example

The following example illustrates a valid lexical comparison function:

CHARACTER*10 CH2
IF (LGT(CH2,'SMITH')) STOP

The IF statement in the previous example is equivalent to the following IF statement:

IF (CH2 .GT. 'SMITH') STOP


Previous Page Next Page Table of Contents