Ini File Format

From OpenM++
Jump to: navigation, search

OpenM++ ini-file fromat

OpenM++ ini-files are similar to other well-known implementations of ini-files. It is a text file consist of [sections] of key = value pairs and optional comments. For example:

Cases = 12345 ; number of cases

; openM++ specific options
SparseOutput = true

Ini-file can contain following lines:

  • section line which is any name in square brackets
  • key = value lines
  • empty lines and comment lines

OpenM++ does not support multi-line values for ini-file, so, you can not have a value contain multiple lines of text, everything must be on one line.

Value can be a string, integer, double or boolean type. Boolean is true if value one of following: "yes", "1", or "true" (case insensitive, i.e.: tRuE) and anything else means false. Double values must be in "C" locale, which means using dot as decimals separator, i.e.: -123456.78e+9

Comments are optional and can start from either semicolon or hash sign at any position of the line. You can escape comment separator by putting value in single 'apostrophes' or double "quotes".

Example of ini-file format recorgnized by openM++:

[Test]               # section comment
 val = no comments
 nul =
 rem = ; comment only and no value
 dsn = "DSN='server'; UID='user'; PWD='secret';"      ; comment: database connection string
 lst = "the # quick # brown" fox 'jumps # over'       # comment: list of test words

; General settings
Cases = 5000        ; only for case-based
SimulationEnd = 100 ; only for time-based
UseSparse = true

# override values of above [Test] section with new values
val=new value of no comments
rem=; comment only and no value
dsn="new value of UID='user'; PWD='secret';"       ; comment: new database connection string
lst=new value of "the # quick" fox 'jumps # over'  # comment: new list of test words

<metadesc>OpenM++: open source microsimulation platform</metadesc>