LF Fortran 95

LLT Function

Description

The LLT function tests whether a string is lexically less than another string based on the ordering of the ASCII collating sequence.

Syntax

LLT (string_a, string_b)

Arguments

string_a is an INTENT(IN) scalar or array of type CHARACTER.

string_b is an INTENT(IN) scalar or array of type CHARACTER.

If string_a and string_b are both arrays, they must have the same shape.

Result

The result is of type default LOGICAL.

Its value is true if string_a precedes string_b in the ASCII collating sequence; otherwise the result is false.

Trailing blanks are ignored.

If both strings are of zero length the result is false.

Example

character(len=3) :: a="abc",b="ABC" character(len=0) :: a1,b1 character(len=5) :: c1(2)=(/"abc ","123 "/) character(len=5) :: c2(2)=(/"CBA "," 123"/) write(*,*) llt(a,b) ! writes F write(*,*) llt(a,c1) ! writes F F write(*,*) llt(c2,a) ! writes T T write(*,*) llt(c1,c2) ! writes F F

Also

ASCII Character Set