mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2003
Posts: 48
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2003
Posts: 48
Not sure if you know about this, or whether you consider it a bug.

When using /var to assign a value, the evaluation of 1-1 does not take place, but when spaced out, 1 - 1 it seems to automatically perform the calculation.

I was creating a calculator for mIRC, so that all of my calculations would be recorded and could be referenced later, and i encountered this little bug. I worked around it.

Last edited by Khaled; 20/02/20 12:33 PM.
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks for your bug report. That is indeed how variable assignment has always worked.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Check out the $calc identifier.

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
For what it is worth: you can prevent this from happening by using either the -n or the (as yet undocumented) -p switch to /var. For example, the following code excerpt:

Code
var -n %test = 1 - 1
echo -ag %test

..will echo "1 - 1". The exact same applies in cases where the input is not literal (e.g. when assigning one variable to another, with such a "formula" as contents).


Saturn, QuakeNet staff

Link Copied to Clipboard