mIRC Homepage
Posted By: Buggs2008 dialog listbox question - 22/03/08 06:39 AM
Hello,

Id like to make an alias to fetch some data from an ini file given the section chosen from a combo drop down list box

so if I select the section ex. [DOGS] in the drop down combo box ini file, I would like to list its values in a seperate edit box

ex.) of .ini file
[DOGS]
1=intelligent animals
2=easy to take care
3=learn fast and quick

what I would like to list in the edit box is all the lines under the section [DOGS] and diplay the lines with the numbers and have them listed in a seperate edit box, Could this be done?

Thanks in advance,

- J
Posted By: tparry Re: dialog listbox question - 22/03/08 08:33 AM
Yes it can be done. What part are you having troubles with?

$ini(mirc.ini,0) = 73
$ini(mirc.ini,1) = chanfolder
$ini(mirc.ini,chanfolder,0) = 38
$ini(mirc.ini,chanfolder,1) = n0
$readini(mirc.ini,n,chanfolder,n0) = #channelname
Posted By: tparry Re: dialog listbox question - 22/03/08 08:40 AM
If this was your dialog entry for your dropbox(ini sections):
combo 141, 20 140 130 85, drop, hsbar, vsbar, tab 1

and the entry for your ini section contents:
list 142, 200 140 130 85, hsbar, vsbar, tab 1

selecting an entry from the dropbox 141 would populate the listbox 142 with this:

on 1:dialog:yourdialog:sclick:141: {
dir -r yourdialog 142
;loop through your ini and add the %data to the listbox
did -a yourdialog 142 %data
}

NOTE: there maybe errors in this, I havent tested it (off the top of my head)
Posted By: jaytea Re: dialog listbox question - 22/03/08 12:48 PM
hi

you can also use /loadbuf -ot to load lines from an ini section to a dialog control. check /help /loadbuf for the exact syntax
Posted By: Buggs2008 Re: dialog listbox question - 22/03/08 04:09 PM
im not exactly familiar with dialogs and stuff, but how would the look like?
© mIRC Discussion Forums