B.1.7 Character_Equal_Status Procedure

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

  function Character_Equal_Status (C, SS) result(Equal)

    ! Input variables.

    type(Status_type), intent(in) :: SS  ! 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(SS),1)   ! SS is valid.

    ! Check equality.

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

    ! Verify guarantees.

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

  end function Character_Equal_Status

Michael L. Hall