mIRC Home    About    Download    Register    News    Help

Print Thread
#207218 10/12/08 12:52 AM
Joined: Nov 2004
Posts: 822
J
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
J
Joined: Nov 2004
Posts: 822
//var -guN %1 = A, %2 = B

Will not unset after N seconds, which I think it should.


Flames/opinions/whatever?

Jigsy #207223 10/12/08 03:00 AM
Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
what "should", in your opinion, be unset... %A or %B, or both? I don't think it's clear in that example which would be the intended behaviour-- which is probably why mIRC chooses none.

Jigsy #207232 10/12/08 06:47 AM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
Seconded... as "//var -sguN %1 = A, %2 = B" shows both results, imho it's clear what the *intended* behavior is. smile


argv0 #207237 10/12/08 01:30 PM
Joined: Nov 2004
Posts: 822
J
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
J
Joined: Nov 2004
Posts: 822
Yeah, sorry, I meant both. :X

argv0 #207239 10/12/08 02:25 PM
Joined: Dec 2002
Posts: 1,996
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,996

IMO, it should just do as it's told and unset both. If the user doesn't want both to be unset then they can set the other(s) with a separate command.

Jigsy #207261 11/12/08 02:41 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
I agree. It should apply to all variables in the list.

If somebody wants to unset two variables after 5 seconds, but also set a permanent one, then they could simply do:

Code:
//var -gu5 %1 = A, %2 = B | var -g %3 = C


Jigsy #207307 12/12/08 09:20 PM
S
Siefer414
Siefer414
S
What does a global variable do that's different from a regular one?

#207308 12/12/08 09:58 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Well it's not a case of global versus regular, but rather a case of global versus local.

A local variable only exists within the scope it is created - it is only accessible within the function/event/etc that created it and it is immediately unset once that function/event/etc ends. Global variables are accessible from anywhere and are permanent unless explicitly unset with the unset command.


Link Copied to Clipboard