has_key Function

private function has_key(me, key)

Returns true if the key is present in the list

Type Bound

list

Arguments

Type IntentOptional Attributes Name
class(list), intent(inout) :: me
class(*), intent(in) :: key

Return Value logical


Calls

proc~~has_key~~CallsGraph proc~has_key list%has_key proc~traverse_list list%traverse_list proc~has_key->proc~traverse_list

Source Code

    function has_key(me,key)

    implicit none

    class(list),intent(inout) :: me
    class(*),intent(in)       :: key
    logical                   :: has_key

    has_key = .false.

    ! traverse the list:
    call me%traverse_list(key_search)

    contains

        subroutine key_search(p,done)
        !! search for the key
        implicit none
        type(node),pointer  :: p
        logical,intent(out) :: done
        has_key = me%keys_equal(p%key,key)
        done = has_key
        end subroutine key_search

    end function has_key