now safe to request values from config-parsing which are not present.
3rd and up value of key "xyz" would return "0" or "0.0" in this example: xyz 1.234 4.321
This commit is contained in:
parent
b5b4b32961
commit
660dce0f09
12
trunk/IO.f90
12
trunk/IO.f90
|
@ -497,10 +497,12 @@ endfunction
|
||||||
integer(pInt), intent(in) :: positions(*),pos
|
integer(pInt), intent(in) :: positions(*),pos
|
||||||
real(pReal) IO_floatValue
|
real(pReal) IO_floatValue
|
||||||
|
|
||||||
if (positions(1) >= pos) then
|
if (positions(1) < pos) then
|
||||||
|
IO_floatValue = 0.0_pReal
|
||||||
|
else
|
||||||
read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_floatValue
|
read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_floatValue
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
return
|
||||||
100 IO_floatValue = huge(1.0_pReal)
|
100 IO_floatValue = huge(1.0_pReal)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -568,10 +570,12 @@ endfunction
|
||||||
integer(pInt), intent(in) :: positions(*),pos
|
integer(pInt), intent(in) :: positions(*),pos
|
||||||
integer(pInt) IO_intValue
|
integer(pInt) IO_intValue
|
||||||
|
|
||||||
if (positions(1) >= pos) then
|
if (positions(1) < pos) then
|
||||||
|
IO_intValue = 0_pInt
|
||||||
|
else
|
||||||
read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_intValue
|
read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_intValue
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
return
|
||||||
100 IO_intValue = huge(1_pInt)
|
100 IO_intValue = huge(1_pInt)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue