Project

General

Profile

$ini » History » Version 5

Per Amundsen, 02/23/2023 01:57 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$ini(file,topic|N,[item|N])*
4
5 2 Per Amundsen
Returns the name/Nth position of the specified topic/item in an INI/text file.
6
7 3 Per Amundsen
_See also [[$readini]]._
8 4 Per Amundsen
_Same as [[$initopic]]._
9 1 Per Amundsen
10
*Parameters*
11
12 5 Per Amundsen
table(ktable).
13
|*Parameter*|*Description*|
14
| file | File to read from. |
15
| topic<notextile>|</notextile>N | Topic or the Nth topic, if N = 0 number of topics, otherwise the Nth topic. |
16
| [item<notextile>|</notextile>N] | Item or the Nth item, if N = 0 number of item, otherwise the Nth item. (optional) |
17 1 Per Amundsen
18
*Examples*
19
20
<pre>
21
; Print number of topics in '$adiircini'.
22
//echo -ag $ini($adiircini,0)
23
24
; Print the name of the first topic in '$adiircini.
25
//echo -ag $ini($adiircini,1)
26
27
; Check if the topic 'Messages' exists.
28
//echo -ag $ini($adiirc,Messages)
29
</pre>