mIRC Homepage
Posted By: Midori $iif(C,T,F) --two cmd's per eval? - 07/03/07 02:27 AM
This has been bugging me for some time:
How do I get $iif() to evaluate two commands for a condition (T/F) w/o having to use a seperate alias.

So far I have tried the following to no avail:
$iif($true,{echo -a hi | echo -a hi2u},noop)
$iif($true,[ echo -a hi | echo -a hi2u ],noop)
$iif($true, [ echo -a true $chr(124) echo -a true2 ] ,noop)
$iif($true,( echo -a hi | echo -a hi2u ),noop)
$eval($iif($true,echo -a hi $chr(124) echo -a hi2u,noop),2)
$eval($iif($true,echo -a hi $chr(124) echo -a hi2u,noop))
$iif($true,$eval(echo -a true [ $chr(124) ] echo -a true2),false)
$iif($true,$eval(echo -a true $chr(124) echo -a true2),false)
$eval($decode($iif($true,ZWNobyAtYSBoaSB8IGVjaG8gLWEgaGkydQ==,noop),m))
$decode($iif($true,ZWNobyAtYSBoaSB8IGVjaG8gLWEgaGkydQ==,noop),m)
$eval($iif($true,$decode(ZWNobyAtYSBoaSB8IGVjaG8gLWEgaGkydQ==,m),noop))

If anyone can figure it out, I'd appreciate it. I have a mess of lame aliases for multi-command instances atm, and I'd like to get rid of them.
Posted By: jaytea Re: $iif(C,T,F) --two cmd's per eval? - 07/03/07 05:42 AM
$iif is not supposed to be used for performing commands! it's supposed to return a value, like an inline if statement. what you've described is exactly what if ( ) { } is for laugh

but if you absolutely insist, there's a sloppy way of evaluating an $iif() and performing two commands:

Code:
//noop $iif($true,$findfile(.,*,1,scon -r echo LOL $(|) echo THIS IS NOOB))


there are certain things to worry about there, particularly since /scon is used, but that's pretty much the simplest way to create an $iif() that evaluates to perform 2 commands (without using aliases or stuff like that)

there are other similar round about ways of accomplishing this, but they're silly, just use an if statement :P
© mIRC Discussion Forums