Simulation Core
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

testjson.f90 1.1 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