json_file_print_2 Subroutine

private subroutine json_file_print_2(me, filename)

Print the JSON structure to the specified filename. The file is opened, printed, and then closed.


Example loading a JSON file, changing a value, and then printing result to a new file:

     type(json_file) :: f
     logical :: found
     call f%load_file('my_file.json')    !open the original file
     call f%update('version',4,found)    !change the value of a variable
     call f%print_file('my_file_2.json') !save file as new name


Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: filename

filename to print to


Source Code

Source Code

    subroutine json_file_print_2(me,filename)

    implicit none

    class(json_file),intent(inout)       :: me
    character(kind=CDK,len=*),intent(in) :: filename  !! filename to print to

    call me%core%print(me%p,filename)

    end subroutine json_file_print_2