mIRC Home    About    Download    Register    News    Help

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

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


Flames/opinions/whatever?


What do you do at the end of the world? Are you busy? Will you save us?
Jigsy #207223 10/12/08 03:00 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Jigsy #207232 10/12/08 06:47 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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: 826
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
Yeah, sorry, I meant both. :X


What do you do at the end of the world? Are you busy? Will you save us?
argv0 #207239 10/12/08 02:25 PM
Joined: Dec 2002
Posts: 2,028
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028

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,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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
Joined: Jun 2008
Posts: 17
S
Pikka bird
Offline
Pikka bird
S
Joined: Jun 2008
Posts: 17
What does a global variable do that's different from a regular one?

Siefer414 #207308 12/12/08 09:58 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard