Simulation Core
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

testjson.f90 1.2 KiB

12345678910111213141516171819202122232425262728
  1. program RedisInterface
  2. use json_module
  3. use CStringConfigurationVariables
  4. type(json_file) :: jsonfile
  5. type(json_value),pointer :: jsonvalue,jsonvalue2,child,child2,jsonvalue3
  6. type(json_core) :: jsoncore
  7. logical :: is_found
  8. integer ::n_children,i,j
  9. type(CStringItem), allocatable :: StringConfigurations(:)
  10. call jsonfile%initialize()
  11. call jsonfile%load_file('data-witharray.json'); if (jsonfile%failed()) stop
  12. call jsonfile%json_file_get_root(jsonvalue)
  13. call jsoncore%get(jsonvalue,'Configuration',jsonvalue2)
  14. call jsoncore%get(jsonvalue2,'StringConfiguration',jsonvalue)
  15. call jsoncore%get(jsonvalue,'StringConfigurationItems',jsonvalue2)
  16. call jsoncore%info(jsonvalue2, n_children=n_children)
  17. do i=1,n_children
  18. call jsoncore%get_child(jsonvalue2, i, child, found=is_found)
  19. if (.not. is_found) print *,"not found"
  20. call jsoncore%get(child,"BitCodeHundreds",child2)
  21. call jsoncore%get(child2,j)
  22. print *,"BitCodeHundreds=",j
  23. end do
  24. print *,"n_children=",n_children
  25. call jsonfile%destroy()
  26. end program