$Ini extras

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

$Ini extras

Post by Vexix » Sat May 22, 2004 10:02 am

Code: /echo ${Ini[test.ini,test]}

With test.ini=
[test]
1=1
2=2
[test2]
Returns:

1|2||

And not 1|2 as expected.

--Vexix

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Sat May 22, 2004 10:07 am

From the old manual (not the new one)...
$ini ("ini filename" [,"keyname"[,"valuename"]])
Retrieves information from an ini file of name "ini filename"
Example:
sample.ini contains:
[KeyOne]
value1=foo
value2=bar

[KeyTwo]
Value3=foobar

$ini(sample.ini,KeyOne,value1) returns "foo"
$ini(sample.ini,KeyOne) returns "value1|value2||"
$ini(sample.ini) returns "KeyOne|KeyTwo||"
Note the samples... It works as it always has, just not as you expected, probably. Use a tokenizer or arg parser to get your sections extracted from an ${Ini[MyFile.ini]} and set "|" as the separator character. Stop if you hit a NULL :)

Maybe we can get Wassap to put those samples in the new readme.chm. They're pretty helpful/explanatory.
--Jerle

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Ah.

Post by Vexix » Sat May 22, 2004 11:57 am

Ah. Working as intended, eh?

Huh. Wonder what the intent behind that was? :roll:

--Vexix

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Ah.

Post by wassup » Sat May 22, 2004 2:16 pm

Vexix wrote:Ah. Working as intended, eh?

Huh. Wonder what the intent behind that was? :roll:

--Vexix
To make people post false bug reports of course!

Anyway, added the example from the old readme into the new as requested. Will be there for the next zip.