mIRC Home    About    Download    Register    News    Help

Print Thread
#94560 17/08/04 09:48 AM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Not sure if this is a bug or just an "undocumented feature", but using this following code:

Code:
dialog testdialog {
  title "Dialog -x"
  size -1 -1 53 19
  option dbu
  button "Close me!", 1, 8 4 37 12, ok
  button "OK", 2, 15 25 14 11, hide ok
}

on *:DIALOG:testdialog:sclick:1:{
  echo -a Closing dialog: $dname
  dialog -x $dname
  echo -a Closed dialog: $dname
}


Results with:
Code:
Closing dialog: testdialog
Closed dialog:

Which shows that for some reason $dname is emptied once a /dialog -x command is performed.

Tested on 6.16. shocked


You won't like it when I get angry.
#94561 17/08/04 11:37 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
This is "normal" behaviour once the dialog has been told to close there is no longer a need to keep $dname.

The same occurs with @windows.

Eamonn.

#94562 17/08/04 12:17 PM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
It's not normal behaviour, because identifiers should keep their values until the script ends.

How is this similar to @windows? $window() is a "global" identifier. $dname is an event-filled identifier. Any identifiers filled within any event should not be emptied until that event code ends. That is normal mIRC behaviour.


You won't like it when I get angry.
#94563 17/08/04 12:40 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
Any identifiers filled within any event should not be emptied until that event code ends. That is normal mIRC behaviour.

- Well apparently not because the same occurs with $target in various input/key* events with @windows, which is what Coolkill is presumably talking about. Maybe it should keep that information, but there's currently nothing that explicitly says that it will keep those identifiers filled.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#94564 17/08/04 12:49 PM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
I just did a test of this, using
Code:
on *:INPUT:@testwin:echo -s $target

Then within @testwin I entered //close -@ $active and it echo'd the $target fine. Could you give an example of where it doesn't occur?


You won't like it when I get angry.
#94565 17/08/04 01:52 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
on *:input:@moo:{
  echo -s Pre: $target
  window -c @moo
  echo -s Post: $target
}


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#94566 17/08/04 01:54 PM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Never noticed that before, thanks.


You won't like it when I get angry.
#94567 22/08/04 11:30 AM
Joined: Dec 2002
Posts: 252
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 252
Simple flawless fix smile in the beginning of the event... var %target = $target or var %dname = $dname, then use the variable for your echo output after the close or just for everything smile


Link Copied to Clipboard