mIRC Home    About    Download    Register    News    Help

Print Thread
$rgb #6564 15/01/03 12:09 AM
Joined: Dec 2002
Posts: 39
L
Larra Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 39
can you use any identifiers inside rgb identifier?
like:
alias myidentifier return 100,100,100
echo -a $myidentifier (works)
echo -a $rgb($myidentifier) (it doesnt)

Re: $rgb #6565 15/01/03 12:25 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
//echo -a * $rgb($gettok($MyIdentifier,1,44),$gettok($MyIdentifier,2,44),$gettok($MyIdentifier,3,44))
* 6579300

$rgb expects 3 parameters, not 1 parameter with commas.

Last edited by Hammer; 15/01/03 12:51 AM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: $rgb #6566 15/01/03 12:50 AM
Joined: Dec 2002
Posts: 39
L
Larra Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 39
emm thanks, I was missunderstanding that

Re: $rgb #6567 15/01/03 01:57 AM
Joined: Dec 2002
Posts: 46
L
LtGuide Offline
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 46
you could also do echo -a $rgb( [ $myidentifier ] )


evil is in the eye of the beholder
Re: $rgb #6568 15/01/03 02:41 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Interesting that [ ] worked when $eval() wouldn't. Good job finding that, though it does mean perhaps a rethink on when to use [ ] and when to use $eval( ,2).


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: $rgb #6569 15/01/03 02:14 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
That's because [ ] brackets and $eval are not the same thing; they are designed for different purposes. $eval evaluates any variables/identifiers in the string and only that. Brackets, otoh, control the order of evaluation, something that $eval was not designed to do of course. So, in $rgb( [ %var ] ) , mirc evaluates %var before it deals with $rgb. (contrary to $rgb(%var), in which %var is evaluated after $rgb is parsed, so %var is considered a parameter).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com