mIRC Home    About    Download    Register    News    Help

Print Thread
Easy access Dynamic varables. #17554 31/03/03 07:27 AM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
It's pretty easy to setup a dynamic varable. Although, without built in support for them you end up with stuff like:
Code:
% [ $+ ping. [ $+ [ $nick ] ] ]
or
[ % $+ [ ping. $+ [ $me ] ] ]


I suggest allowing a command like %(ping. $+ $nick) to be equal to [ % $+ [ ping. $+ [ $me ] ] ]. Also allowing stuff like $(Join. $+ $network) so that everything in the () directly concatinated is evaluated then checked against varables or aliases.

Re: Easy access Dynamic varables. #17555 31/03/03 09:09 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
$eval($+(%,Join.,$network),2) already works. OK so it's two identifiers but still it allows the code to be grouped into parentheses. And of course to get the variable name you simply remove the surrounding $eval().


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: Easy access Dynamic varables. #17556 31/03/03 03:33 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You came pretty close to reality: $($+(%,Join.,$network),2) is the same as $eval($+(%,Join.,$network),2). Any other way to evaluate dynamic vars would be incompatible with the scripting language and would break scripts. For example, currently, you can have a variable named %(ping. Changes are worth breaking existing scripts only if they enhance functionality considerably, imo.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Easy access Dynamic varables. #17557 31/03/03 04:12 PM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Drat, you're right. I was assuming '(' & ')' weren't usable for varables. Oh well.