mIRC Home    About    Download    Register    News    Help

Print Thread
#94560 17/08/04 09:48 AM
Joined: Dec 2002
Posts: 264
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 264
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

#94561 17/08/04 11:37 AM
Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
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: 264
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 264
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.

#94563 17/08/04 12:40 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
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.

#94564 17/08/04 12:49 PM
Joined: Dec 2002
Posts: 264
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 264
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?

#94565 17/08/04 01:52 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Code:
on *:input:@moo:{
  echo -s Pre: $target
  window -c @moo
  echo -s Post: $target
}

#94566 17/08/04 01:54 PM
Joined: Dec 2002
Posts: 264
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 264
Never noticed that before, thanks.

#94567 22/08/04 11:30 AM
Joined: Dec 2002
Posts: 251
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 251
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