Get the number of values of option data.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
Number of values.
elemental function count_values(self, delimiter) result(Nv)
!< Get the number of values of option data.
class(option), intent(in) :: self !< Option data.
character(*), intent(in), optional :: delimiter !< Delimiter used for separating values.
character(len=:), allocatable :: dlm !< Dummy string for delimiter handling.
integer(I4P) :: Nv !< Number of values.
if (self%ovals%is_allocated()) then
dlm = ' ' ; if (present(delimiter)) dlm = delimiter
Nv = self%ovals%count(dlm) + 1
else
Nv = 0
endif
endfunction count_values