Returns true if the key is present in the list
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | me | |||
| class(*), | intent(in) | :: | key |
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