Loop returning option name/value defined into section.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(section), | intent(in) | :: | self | Section data. |
||
character(len=:), | intent(out), | allocatable | :: | option_pairs(:) | Couples option name/value [1:2]. |
Flag continuing the loop.
function loop(self, option_pairs) result(again)
!< Loop returning option name/value defined into section.
class(section), intent(in) :: self !< Section data.
character(len=:), allocatable, intent(out) :: option_pairs(:) !< Couples option name/value [1:2].
logical :: again !< Flag continuing the loop.
integer(I4P), save :: o=0 !< Counter.
again = .false.
if (allocated(self%options)) then
if (o==0) then
o = lbound(self%options, dim=1)
call self%options(o)%get_pairs(pairs=option_pairs)
again = .true.
elseif (o<ubound(self%options, dim=1)) then
o = o + 1
call self%options(o)%get_pairs(pairs=option_pairs)
again = .true.
else
o = 0
again = .false.
endif
endif
endfunction loop