mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2008
Posts: 5
B
Blaize Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Jan 2008
Posts: 5
Hi folks!

I'm relatively new to this, so I hope I can explain my problem in a way that's not too irritating!

I a bunch of aliases that have 1 of 2 beginning parts of the alias name. For example:

getmodelRegal
getmodelCentury
getmakeBuick
getmakeFord
etc.

listmodelRegal
listmodelCentury
listmakeBuick
listmakeFord
etc.

I made an alias called docat that returns the uncommon part of the name of the aliases listed above. So it returns things like modelRegal or makeBuick

Now, here's the problem, I need to combine the string returned by docat with the common name of the aliases list or get and get it to properly execute the command.

The code I have in there now is like this:

UC $1 $get $+ $docat(%sel) $+ ($1) | return

An example of what I want it to execute after everything is resolved is this:

UC $1 $getmodelRegal($1)

Is there any way to pull this off? The code I have in there doesn't work properly. Any help is greatly appreciated - this one line of code is the difference between efficiency and bloat for me! Thanks in advance!

Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Try this:

UC $1 $+($,get,$docat(%sel),$chr(40),$1,$chr(41))

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
UC $1 $eval($!get $+ $docat(%sel) $+ ($1), 2) | return


$eval(code, number) makes mIRC evaluate code, number times, in your case, you want it to evaluate twice: once to get the identifier name, and then again to get the value it returns. The use of ! is to prevent the first round of evaluation from trying to evaluate $get as an identifier by itself (The $1 doesn't need it because in the first round of evaluation the $ is preceded by a ( so mIRC doesn't try to evaluate it).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jan 2008
Posts: 5
B
Blaize Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Jan 2008
Posts: 5
Worked like a charm! Thanks much to both of you!

Last edited by Blaize; 13/01/08 06:45 PM.
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
lol, im no good at the eval commmand, why would you want it?.. whats it do, other than evaluate x, y number of times..?


This is not the signature you are looking for

Link Copied to Clipboard