inifilesection
¶
This is the type for the referenced section of an ini file. The Index passed to Section[] is optional. Passing an Index means it will search for matches to that Index. Not passing an Index references all sections for operations that allow it.
Members¶
int Count
¶
- How many sections matching the Section[] index exist.
bool Exists
¶
- Whether a specific section exists.
inifilesectionkey Key
¶
- A reference to the named or unnamed key in this specific ini file section.
Examples¶
Given the sample.ini file:
[Section1]
Key1=foo
Key2=bar
[Section1]
Key1=bar
Key2=foo
[Section2]
Key=foo
Key=bar
Key=foobar
Example
How many sections are there?
/echo ${Ini.File[Sample].Section.Count}
3
How many sections named "Section1" are there?
/echo ${Ini.File[Sample].Section[Section1].Count}
2
Does "Section3" exist?
/echo ${Ini.File[Sample].Section[Section3].Exists}
FALSE
How many sections are there?
print(mq.TLO.Ini.File("Sample").Section.Count())
3
How many sections named "Section1" are there?
print(mq.TLO.Ini.File("Sample").Section("Section1").Count()}
2
Does "Section3" exist?
print(mq.TLO.Ini.File("Sample").Section("Section3").Exists()}
false