Change the json_value variable to an array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | pointer | :: | p | |||
character(kind=CK,len=*), | intent(in), | optional | :: | name | if the name is also to be changed. |
subroutine to_array(json,p,name)
implicit none
class(json_core),intent(inout) :: json
type(json_value),pointer :: p
character(kind=CK,len=*),intent(in),optional :: name !! if the name is also to be changed.
!set type and value:
call destroy_json_data(p)
p%var_type = json_array
!name:
if (present(name)) call json%rename(p,name)
end subroutine to_array