mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 10
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Apr 2003
Posts: 10
alias var1 {
var %a.1 = b
echo $+(%,a.1:) %a.1
}
alias var2 {
var %a $+ .1 = b
echo $+(%,a.1:) %a.1
}
alias var3 {
var $+(%,a.1) = b
echo $+(%,a.1:) %a.1
}

/var1 displays: %a.1: b
/var2 displays: %a.1: = b
/var3 displays: %a.1:

/set command has no such a problem.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Looks like a bug to me. set -l $+(%,a.1) b well do the job for it tho.


Aa a side note there really isnt any VAR command in mirc. /me wonders why everyone looks at me like im crazy!

Well it becomes SET -l, i say there isnt a command because you cant trap it with an alias, so its a preprocessed directive rather than a command.

Try this....
alias set { echo COMMAND SET $1- | set $1- }
alias var { echo COMMAND VAR $1- | var $1- }
alias ex1 { var %text 123 }

then from the command line
/set %test 123
COMMAND SET %test 123
//set %test 123
COMMAND SET %test 123
/var %test 123
COMMAND VAR %test 123 for what ever reason it is located as a command here but this is the only place
//var %test 123
COMMAND SET -l %test 123
/ex1
COMMAND SET -l %text 123 as you see its not caught by the VAR alias

Joined: Nov 2003
Posts: 25
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Nov 2003
Posts: 25
additional comments here

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
This is not a bug as much as it is an ancient functionality of /var

the first param of /var must begin with a %, not a $

Secondly, the correct way to write it with a var is to "ignore" the '=' rule and just do:

//var %v $+ b 1 | echo -a %vb
Echo's 1

Note that I didn't use = there. Yes, it's not the documented way to use var, but it works. It's kind of a minor bug I suppose, but it's really been around forever, since the 5.6 days iirc. You just gotta get used to breaking some rules when dealing with mirc script :P


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard