mIRC Home    About    Download    Register    News    Help

Print Thread
need to convert to string and then execute string #192966 13/01/08 04:07 PM
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!

Re: need to convert to string and then execute str [Re: Blaize] #192969 13/01/08 04:24 PM
Joined: Apr 2006
Posts: 464
O
OrionsBelt Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Try this:

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

Re: need to convert to string and then execute str [Re: Blaize] #192970 13/01/08 05:08 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
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.
Re: need to convert to string and then execute str [Re: OrionsBelt] #192979 13/01/08 06:44 PM
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.
Re: need to convert to string and then execute str [Re: Blaize] #193014 14/01/08 01:55 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline
Fjord artisan
Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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