-
Notifications
You must be signed in to change notification settings - Fork 5
Taste
Stefano Zaghi edited this page Mar 31, 2015
·
1 revision
This example demonstrates the some IO feature of FiNeR.
USE Lib_INI_IO
type(Type_File_INI):: fini ! INI File.
call fini%load(source=source)
USE Lib_INI_IO
type(Type_File_INI):: fini ! INI File.
call fini%add(section='sec-foo')
call fini%add(section='sec-foo',option='bar',val=-32.1_R8P)
call fini%add(section='sec-foo',option='baz',val=' hello FiNeR! ')
call fini%add(section='sec-foo',option='array',val=[1,2,3,4])
call fini%add(section='sec-bar')
call fini%add(section='sec-bar',option='bools',val=[.true.,.false.,.false.])
call fini%save(filename='foo.ini')
USE Lib_INI_IO
type(Type_File_INI):: fini ! INI File.
...
if (fini%has_section(section='foo')) then
! do something with foo
endif
USE Lib_INI_IO
type(Type_File_INI):: fini ! INI File.
...
call fini%print(pref=' ',unit=stdout)
These examples and many others are contained into the ini_autotest
procedure. Run the Test_Driver
program for checking them.