Elemental Intrinsic Function (Generic): Determines whether a string is lexically greater than another string, based on the ASCII collating sequence, even if the processor's default collating sequence is different. In Intel® Fortran, LGT is equivalent to the > (.GT.) operator.
result = LGT (string_a,string_b)
string_a |
(Input) Must be of type character. |
string_b |
(Input) Must be of type character. |
The result type is default logical. If the strings are of unequal length, the comparison is made as if the shorter string were extended on the right with blanks, to the length of the longer string.
The result is true if string_a follows string_b in the ASCII collating sequence; otherwise, the result is false. If both strings are of zero length, the result is also false.
LGT ( 'TWO', 'THREE' ) has the value true.
LGT ( 'ONE', 'FOUR' ) has the value true.
The following shows another example:
LOGICAL L
L = LGT('ABC', 'ABC') ! returns .FALSE.
L = LGT('ABC', 'AABC') ! returns .TRUE.