Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | header |
pure function find_header_index(this, header) result(index) class(data_frame), intent(in) :: this character(len=*), intent(in) :: header integer :: index integer :: i character(len=:), allocatable :: trimmed_header if (.not. this % with_headers) error stop "data frame has no headers" trimmed_header = trim(adjustl(header)) index = -1 do i = 1, this % num_cols if (trim(adjustl(this % headers(i))) == trimmed_header) then index = i exit end if end do if (index == -1) error stop "header not found" end function find_header_index