always search for last occurrence
This commit is contained in:
parent
674d2ea61a
commit
8739bada26
|
@ -297,19 +297,19 @@ real(pReal) function getFloat(this,key,defaultVal)
|
||||||
logical :: found
|
logical :: found
|
||||||
|
|
||||||
if (present(defaultVal)) getFloat = defaultVal
|
if (present(defaultVal)) getFloat = defaultVal
|
||||||
found = .false.
|
found = present(defaultVal)
|
||||||
|
|
||||||
item => this%next
|
item => this%next
|
||||||
do while (associated(item) .and. .not. found)
|
do while (associated(item))
|
||||||
found = trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)
|
if (trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)) then
|
||||||
if (found) then
|
found = .true.
|
||||||
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
||||||
getFloat = IO_FloatValue(item%string%val,item%string%pos,2)
|
getFloat = IO_FloatValue(item%string%val,item%string%pos,2)
|
||||||
endif
|
endif
|
||||||
item => item%next
|
item => item%next
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if (.not. found .and. .not. present(defaultVal)) call IO_error(140_pInt,ext_msg=key)
|
if (.not. found) call IO_error(140_pInt,ext_msg=key)
|
||||||
|
|
||||||
end function getFloat
|
end function getFloat
|
||||||
|
|
||||||
|
@ -332,19 +332,19 @@ integer(pInt) function getInt(this,key,defaultVal)
|
||||||
logical :: found
|
logical :: found
|
||||||
|
|
||||||
if (present(defaultVal)) getInt = defaultVal
|
if (present(defaultVal)) getInt = defaultVal
|
||||||
found = .false.
|
found = present(defaultVal)
|
||||||
|
|
||||||
item => this%next
|
item => this%next
|
||||||
do while (associated(item) .and. .not. found)
|
do while (associated(item))
|
||||||
found = trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)
|
if (trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)) then
|
||||||
if (found) then
|
found = .true.
|
||||||
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
||||||
getInt = IO_IntValue(item%string%val,item%string%pos,2)
|
getInt = IO_IntValue(item%string%val,item%string%pos,2)
|
||||||
endif
|
endif
|
||||||
item => item%next
|
item => item%next
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if (.not. found .and. .not. present(defaultVal)) call IO_error(140_pInt,ext_msg=key)
|
if (.not. found) call IO_error(140_pInt,ext_msg=key)
|
||||||
|
|
||||||
end function getInt
|
end function getInt
|
||||||
|
|
||||||
|
@ -369,12 +369,12 @@ character(len=65536) function getString(this,key,defaultVal,raw)
|
||||||
|
|
||||||
if (present(defaultVal)) getString = defaultVal
|
if (present(defaultVal)) getString = defaultVal
|
||||||
split = merge(raw,.true.,present(raw))
|
split = merge(raw,.true.,present(raw))
|
||||||
found = .false.
|
found = present(defaultVal)
|
||||||
|
|
||||||
item => this%next
|
item => this%next
|
||||||
do while (associated(item) .and. .not. found)
|
do while (associated(item))
|
||||||
found = trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)
|
if (trim(IO_stringValue(item%string%val,item%string%pos,1)) == trim(key)) then
|
||||||
if (found) then
|
found = .true.
|
||||||
if (split) then
|
if (split) then
|
||||||
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
if (item%string%pos(1) < 2_pInt) call IO_error(143_pInt,ext_msg=key)
|
||||||
getString = IO_StringValue(item%string%val,item%string%pos,2)
|
getString = IO_StringValue(item%string%val,item%string%pos,2)
|
||||||
|
@ -385,7 +385,7 @@ character(len=65536) function getString(this,key,defaultVal,raw)
|
||||||
item => item%next
|
item => item%next
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if (.not. found .and. .not. present(defaultVal)) call IO_error(140_pInt,ext_msg=key)
|
if (.not. found) call IO_error(140_pInt,ext_msg=key)
|
||||||
|
|
||||||
end function getString
|
end function getString
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue