Fortran provides four lexical comparison functions:
Lexical functions take the following form:
func (c,c)
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.
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