B.1.14 Status_Equal_Character Procedure

The main documentation of the Status_Equal_Character Procedure contains additional explanation of this code listing.

  function Status_Equal_Character (S, C) result(Equal)

    ! Input variables.

    type(Status_type), intent(in) :: S  ! Status variable to be compared.
    type(character,*), intent(in) :: C   ! Selector flag string to be compared.

    ! Output variable.

    type(logical) :: Equal               ! Equality boolean.

    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ! Verify requirements.

    VERIFY(Valid_State(S),1)   ! S is valid.

    ! Check equality.

    Equal = status_flag(S%status)%selector == C

    ! Verify guarantees.

    ! Equal should be what it was set to.
    VERIFY(Equal .eqv. (status_flag(S%status)%selector == C),2)

    return
  end function Status_Equal_Character



Michael L. Hall