Thanks all.
Use the n switch of $readini and use /var -p
This seems to do the job so far
However if the ini file does not contain the key
some_text,
I need to set it manually to (my default value) "
foo " in my script code.
How do I do this please? Here is my code snippet:
on *:INPUT:*:{
[...]
var -p %value = $readini(%my_ini,n,Alpha,some_text)
if (%value == $null) { %value = foo $+ $char(32) }
echo -a %value
var %valueLen = $len(%value)
if (%value != $left($1-,%valueLen)) {
>> do some magic here <<
}
}
So when the key can't be read because it does not exist in the .ini, I try to set it manually using
if (%value == $null) { %value = foo $+ $char(32) }When I do a
/echo -a %value after setting it, it says "foo" instead of the expected "foo ", also the following lenght check fails.
What am I doing wrong?