mIRC Home    About    Download    Register    News    Help

Topic Options
#6564 - 15/01/03 12:09 AM $rgb
Larra Offline
Ameglian cow

Registered: 09/12/02
Posts: 39
Loc: Spain
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)

Top
#6565 - 15/01/03 12:25 AM Re: $rgb
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
//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.


Edited by Hammer (15/01/03 12:51 AM)
_________________________
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Top
#6566 - 15/01/03 12:50 AM Re: $rgb
Larra Offline
Ameglian cow

Registered: 09/12/02
Posts: 39
Loc: Spain
emm thanks, I was missunderstanding that

Top
#6567 - 15/01/03 01:57 AM Re: $rgb
LtGuide Offline
Babel fish

Registered: 26/12/02
Posts: 46
Loc: Jacksonville, NC, US
you could also do echo -a $rgb( [ $myidentifier ] )
_________________________
evil is in the eye of the beholder

Top
#6568 - 15/01/03 02:41 AM Re: $rgb
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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

Top
#6569 - 15/01/03 02:14 PM Re: $rgb
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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

Top