mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2007
Posts: 27
V
Vliedel Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: May 2007
Posts: 27
Well the topic says it all. I'd like to see some switch so that when you /var %bla = 2 - 1, it doesn't become "1" but "2 - 1". Perhaps the -n like for /set

Last edited by Vliedel; 27/08/08 03:27 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You can use /set -l (unfortunately undocumented) to set a local variable:

//set -ln %bla 2 - 1

I guess if anything, set -l should be documented


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
I like the suggestion, but I would like to ask such an extra switch to cause /var to do two more things:
  • not lose the last single space of whatever is given [1];
  • not reduce any pair of double quotes ("") to $null.
Then, you can for example do "/var -n %x = $1" so that %x will end up with the exact same contents as $1, regardless of what $1 contained. Because of the three issues mentioned now, that is currently simply impossible (and the two above are impossible to solve with /set as well).

[1] Example: //var %x = a $+ $chr(32), %y = a $+ $chr(32) $+ $chr(32) | echo -ag $len(%x) $len(%y)


Saturn, QuakeNet staff
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

~ Edit ~
Nevermind what I said before, I got confused. I too would very much like to see the -n switch also work for the /var command.


Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
If the variable is going to be used for display purposes then for the time being you could insert double bold chars before the 2 (var %bla = ^b^b2 - 1)


Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I've already reported this some time ago but i'm unable to found the thread, i agree for the var -n, but set -ln is sufficient.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
If you're gonna use a hack on var, it might as well be var %x = $chr(32) 2 - 1, not bold codes, granted it's a little longer looking.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2007
Posts: 27
V
Vliedel Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: May 2007
Posts: 27
Yeah i know there are ways to avoid this problem, it would just be nicer to be able to use the -n switch. But I guessed it's not a big thing to implement (unlike the space problem).

Last edited by Vliedel; 28/08/08 10:46 AM.

Link Copied to Clipboard