mIRC Homepage
Posted By: zack /dialog -x and $dname - 17/08/04 09:48 AM
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
Posted By: Coolkill Re: /dialog -x and $dname - 17/08/04 11:37 AM
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.
Posted By: zack Re: /dialog -x and $dname - 17/08/04 12:17 PM
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.
Posted By: starbucks_mafia Re: /dialog -x and $dname - 17/08/04 12:40 PM
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.
Posted By: zack Re: /dialog -x and $dname - 17/08/04 12:49 PM
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?
Posted By: starbucks_mafia Re: /dialog -x and $dname - 17/08/04 01:52 PM
Code:
on *:input:@moo:{
  echo -s Pre: $target
  window -c @moo
  echo -s Post: $target
}
Posted By: zack Re: /dialog -x and $dname - 17/08/04 01:54 PM
Never noticed that before, thanks.
Posted By: Talon Re: /dialog -x and $dname - 22/08/04 11:30 AM
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
© mIRC Discussion Forums