Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(in), | pointer | :: | me | ||
logical(kind=LK), | intent(inout) | :: | value |
Get a logical value from a json_value.
subroutine json_get_logical(me, value)
implicit none
type(json_value),pointer,intent(in) :: me
logical(LK) :: value
value = .false.
if ( exception_thrown ) return
select case (me%var_type)
case (json_integer)
value = (me%int_value > 0)
case (json_logical)
value = me % log_value
case default
call throw_exception('Error in json_get_logical:'//&
' Unable to resolve value to logical: '//me%name)
end select
end subroutine json_get_logical