Project

General

Profile

$initopic » History » Version 2

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

1 1 Per Amundsen
_Added in 1.9.9_
2
3
*$initopic(file,topic|N,[item|N])*
4
5
Returns the name/Nth position of the specified topic/item in an INI/text file.
6
7
_See also [[$readini]]._
8
_Same as [[$ini]]._
9
10
*Parameters*
11
12 2 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 $initopic($adiircini,0)
23
24
; Print the name of the first topic in '$adiircini.
25
//echo -ag $initopic($adiircini,1)
26
27
; Check if the topic 'Messages' exists.
28
//echo -ag $initopic($adiirc,Messages)
29
</pre>