get_header Function

private function get_header(this, index) result(header)

Type Bound

data_frame

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
integer, intent(in) :: index

Return Value character(len=:), allocatable


Source Code

    function get_header(this, index) result(header)
        class(data_frame), intent(in) :: this
        integer, intent(in) :: index
        character(len=:), allocatable :: header

        if (.not. this % with_headers) error stop "data frame has no headers"
        if (index < 1 .or. index > this % num_cols) error stop "header index out of range"

        header = trim(this % headers(index))
    end function get_header