mIRC Home    About    Download    Register    News    Help

Print Thread
$dialog data? #1348 12/12/02 11:25 AM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
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..?

Re: $dialog data? #1349 12/12/02 11:45 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$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.

Re: $dialog data? #1350 12/12/02 12:05 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.

Re: $dialog data? #1351 12/12/02 12:06 PM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
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 $$?

Re: $dialog data? #1352 12/12/02 01:14 PM
Joined: Dec 2002
Posts: 20
S
Spola Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
try it!

(yes)


you guys are so not L334
Re: $dialog data? #1353 13/12/02 12:59 AM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Re: $dialog data? #1354 13/12/02 01:13 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: $dialog data? #1355 13/12/02 01:26 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
no need to get mad... read hammer's post, or mine above...

Re: $dialog data? #1356 13/12/02 07:53 PM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
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

Re: $dialog data? #1357 14/12/02 12:30 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
/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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: $dialog data? #1358 14/12/02 12:34 AM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
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