mIRC Home    About    Download    Register    News    Help

Print Thread
/var switch to stop it calculating #203793 27/08/08 03:24 PM
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.
Re: /var switch to stop it calculating [Re: Vliedel] #203795 27/08/08 04:09 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: /var switch to stop it calculating [Re: Vliedel] #203796 27/08/08 04:21 PM
Joined: Apr 2004
Posts: 847
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 847
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
Re: /var switch to stop it calculating [Re: Vliedel] #203797 27/08/08 05:29 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

~ 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.


Re: /var switch to stop it calculating [Re: Vliedel] #203812 28/08/08 12:29 AM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
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)


Re: /var switch to stop it calculating [Re: Vliedel] #203816 28/08/08 02:03 AM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /var switch to stop it calculating [Re: hixxy] #203819 28/08/08 04:37 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: /var switch to stop it calculating [Re: Vliedel] #203823 28/08/08 10:46 AM
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.