mIRC Homepage
Posted By: Vliedel /var switch to stop it calculating - 27/08/08 03:24 PM
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
Posted By: argv0 Re: /var switch to stop it calculating - 27/08/08 04:09 PM
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
Posted By: Sat Re: /var switch to stop it calculating - 27/08/08 04:21 PM
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)
Posted By: RoCk Re: /var switch to stop it calculating - 27/08/08 05:29 PM

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

Posted By: hixxy Re: /var switch to stop it calculating - 28/08/08 12:29 AM
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)

Posted By: Wims Re: /var switch to stop it calculating - 28/08/08 02:03 AM
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.
Posted By: argv0 Re: /var switch to stop it calculating - 28/08/08 04:37 AM
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.
Posted By: Vliedel Re: /var switch to stop it calculating - 28/08/08 10:46 AM
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).
© mIRC Discussion Forums