ini sub-value comparison - 26/01/07 07:59 PM
i have problem in understanding things :P
some ppl from this board made this 2 alises
this one only show SUBSECTIONS
and this one shows only VALUES
problem is that (in something im doing) i need to compare
subsection with what value it has and echo it in additional change like:
[section]
Trout=dead
Catfish=alive
so i need comparison in way:
IF Trout has VALUE DEAD { echo Trout is realy dead }
IF Catfish has VALUE ALIVE { echo Catfish is alive }
excuse my lame explanation
so i have those aliases (above) that return me
these info i need (section and value)
but i dont know how to compare them and then
echo some result based on this comparison...
so if anyone could explain a bit detailed this
or make simple code to show me how to do this
i would apreciate it alot.
some ppl from this board made this 2 alises
this one only show SUBSECTIONS
Code:
alias inisub { ; Syntax: /inisub <section> <path\file> if (!$isfile($2-)) .echo -a File doesn't exist. $+($chr(40),$2-,$chr(41)) elseif (!$ini($2-,$1)) .echo -a Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41)) else { var %i = 1 while ($ini($2-,$1,%i) != $null) { .echo -a $v1 inc %i } } }
and this one shows only VALUES
Code:
alias inival { ; Syntax: /inival <section> <path\file> if (!$isfile($2-)) .echo -a File doesn't exist. $+($chr(40),$2-,$chr(41)) elseif (!$ini($2-,$1)) .echo -a Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41)) else { var %i = 1 while ($readini($2-,$1,$ini($2-,$1,%i)) != $null) { .echo -a $v1 inc %i } } }
problem is that (in something im doing) i need to compare
subsection with what value it has and echo it in additional change like:
[section]
Trout=dead
Catfish=alive
so i need comparison in way:
IF Trout has VALUE DEAD { echo Trout is realy dead }
IF Catfish has VALUE ALIVE { echo Catfish is alive }
excuse my lame explanation
so i have those aliases (above) that return me
these info i need (section and value)
but i dont know how to compare them and then
echo some result based on this comparison...
so if anyone could explain a bit detailed this
or make simple code to show me how to do this
i would apreciate it alot.