mIRC Home    About    Download    Register    News    Help

Print Thread
#4882 04/01/03 05:46 PM
Joined: Jan 2003
Posts: 12
G
Gawain Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Jan 2003
Posts: 12
First of all, let me welcome you (the board and all it's users) back. You have been sorely missed. Also, wishes for a happy new year to everyone.

Now my Q: Is it possible to get the comparisonstatement (for an IF) from a .ini file? I've tried it a couple of times, and it seems the statement is true just because the item in the ini-file it checks exists. It doesn't really evaluate it as a statement.

Did that make any sense to anyone? Hehe. Maybe an example..

Let's say temp.ini contains something like this:
[start]
req=-1 > 0
Code:
 if ($readini(temp.ini,start,req)) {
...
} 


We all know -1 is NOT greater than 0, but the expression is still evaluated as true. Any bright ideas? confused (no [] doesn't help, or i'm doing it wrong) Thanks!


-TS
#4883 04/01/03 05:56 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
if ($eval($readini(temp.ini,start,req),2))

should work


Code:
//if ( khaled isgod ) echo yes | else echo no
#4884 04/01/03 07:40 PM
Joined: Jan 2003
Posts: 12
G
Gawain Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Jan 2003
Posts: 12
Of course it should.. but it doesn't wink
$eval(...,N) just does the same as N pairs of [] as far as i know..


-TS
#4885 04/01/03 10:40 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
well, it seems to be a bug
use:
var %thing = $readini(file.ini,section,stuff)
if ( $eval( %thing , 2 ) )

it seems to work

remember to report this to bug board also


Code:
//if ( khaled isgod ) echo yes | else echo no

Link Copied to Clipboard