string_le_string Function

private elemental function string_le_string(lhs, rhs) result(is_it)

Lower equal than to string logical operator.

 type(string) :: astring
 type(string) :: anotherstring
 logical      :: test_passed(3)
 astring = 'one'
 anotherstring = 'ONE'
 test_passed(1) = ((astring<=anotherstring).eqv..false.)
 astring = 'ONE'
 anotherstring = 'one'
 test_passed(2) = ((astring<=anotherstring).eqv..true.)
 astring = 'ONE'
 anotherstring = 'ONE'
 test_passed(3) = ((astring<=anotherstring).eqv..true.)
 print '(L1)', all(test_passed)

Type Bound

string

Arguments

Type IntentOptional Attributes Name
class(string), intent(in) :: lhs

Left hand side.

type(string), intent(in) :: rhs

Right hand side.

Return Value logical

Opreator test result.


Contents

Source Code


Source Code

   elemental function string_le_string(lhs, rhs) result(is_it)
   !< Lower equal than to string logical operator.
   !<
   !<```fortran
   !< type(string) :: astring
   !< type(string) :: anotherstring
   !< logical      :: test_passed(3)
   !< astring = 'one'
   !< anotherstring = 'ONE'
   !< test_passed(1) = ((astring<=anotherstring).eqv..false.)
   !< astring = 'ONE'
   !< anotherstring = 'one'
   !< test_passed(2) = ((astring<=anotherstring).eqv..true.)
   !< astring = 'ONE'
   !< anotherstring = 'ONE'
   !< test_passed(3) = ((astring<=anotherstring).eqv..true.)
   !< print '(L1)', all(test_passed)
   !<```
   !=> T <<<
   class(string), intent(in) :: lhs   !< Left hand side.
   type(string),  intent(in) :: rhs   !< Right hand side.
   logical                   :: is_it !< Opreator test result.

   is_it = lhs%raw <= rhs%raw
   endfunction string_le_string