Get section name once an index (valid) is provided.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_ini), | intent(in) | :: | self | File data. |
||
integer(kind=I4P), | intent(in) | :: | section_index | Section index. |
Section name.
pure function section_file_ini(self, section_index) result(sname)
!< Get section name once an index (valid) is provided.
class(file_ini), intent(in) :: self !< File data.
integer(I4P), intent(in) :: section_index !< Section index.
character(len=:), allocatable :: sname !< Section name.
if (allocated(self%sections)) then
if ((section_index >= lbound(self%sections, dim=1)).and.(section_index <= ubound(self%sections, dim=1))) then
sname = self%sections(section_index)%name()
endif
endif
endfunction section_file_ini