mIRC Homepage

$dialog data?

Posted By: NightChillz

$dialog data? - 12/12/02 11:25 AM

hey, i am just wondering how you retrive data from a dialog created with $dialog , like $input or $? returns the data in an edit box or on whatever button was pressed, but if i create a dialog with the $dialog identifer, can i retrieve that data when the ok button is pressed, the data in all the edit boxes/listboxes or whatnot, or would i have to go about it in the actual dialog coding events
eg:

on dialog.......sclick:okbuttonID:{
if ($dialog(dialog.name).modal == $true) {
then do this for what i want with the edit boxes and so on
}
}

am i heading the right way with how you would get data it when created like that, or is there another way that wors like $input or whatever..?
Posted By: Collective

Re: $dialog data? - 12/12/02 11:45 AM

$did(dialogname,id).text
Eg.
$did(Music,1).text returns the text in id 1 of the "Music" dialog.

Type "/help dialogs" and scroll down to the $did section.
Posted By: Online

Re: $dialog data? - 12/12/02 12:05 PM

or add the result property to the editbox whose value will be returned once the dialog is closed. see the help file for more info on the result property.
Posted By: NightChillz

Re: $dialog data? - 12/12/02 12:06 PM

yeah i know ALL that stuff, but what i am asking, is "for example" when you make a call to $input or $$?

it returns a result of the edit bod, or the button press depending on the case, so if you use $input and have an edit box, then $input RETURNS whatever was typed into the edit box, what i want to know is, can we do the same with a call to $dialog(whatever,whatever)

as to where, when the dialog CLOSES/YOUR done with it, it will return a value or result, as does a call to $input or $$?
Posted By: Spola

Re: $dialog data? - 12/12/02 01:14 PM

try it!

(yes)
Posted By: NightChillz

Re: $dialog data? - 13/12/02 12:59 AM

I did try it, i opened with //var %a = $dialog(test,test) | echo -a %a

and it got an echo error,

AND THATS WHY I came here and ASKED if there was a way to do it, CAUSE I TRIED by what i understood from the help file, and it isnt returning anything, but in my opinio if the dialog halts the script pending input, then it should return a result when the dialog closes, but it wasnt, so i came here to ask if there was a way to do it that i might be missing or something!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Posted By: Hammer

Re: $dialog data? - 13/12/02 01:13 AM

Code:

dialog t3st {
  option dbu
  title T3st1ng...
  size -1 -1 200 65
  text "This is some random text i just put here to be a prompt.", 1, 5 5 190 15
  edit "", 2, 5 25 190 15, result
  button "OK", 3, 90 45 20 13, ok
}
alias t3st dialog -m t3st t3st

//echo -a $$dialog(t3st,t3st)
Posted By: Online

Re: $dialog data? - 13/12/02 01:26 AM

no need to get mad... read hammer's post, or mine above...
Posted By: NightChillz

Re: $dialog data? - 13/12/02 07:53 PM

ok, i see what you mean with the "result" property....now, is it possible to return several results from a variety of editboxes and list/combo box with that same function...?

or is it predefined to only return one result
Posted By: Hammer

Re: $dialog data? - 14/12/02 12:30 AM

/Set the results you want into variables (possibly with a timed unset) in your on *:DIALOG:dname:close:*: event, or your OK button sclick event, but make sure they are unset if you cancel.
Posted By: NightChillz

Re: $dialog data? - 14/12/02 12:34 AM

yeah, i gave returning multiple result ID"s a try, but it would just return the last resulr ID data, this was just an option i was examining, trying to find the best way to do it, but i think i will just call a modeless dialog, and return the data i want with using the OK button sclick and the text i need from each $did, thanks for the help and suggestions tho everyone smile
© 2022 mIRC Discussion Forums