mIRC Home    About    Download    Register    News    Help

Print Thread
#105492 16/12/04 06:01 PM
Joined: Dec 2004
Posts: 12
D
Depodra Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2004
Posts: 12
Hi,
i've read the help file on Dialogs but it explains nothing of List...
i'd like to list the files of a certain directory... is there any possible way of doing this? if so, please reply with a solution

thanks in advance for any assistance

#105493 16/12/04 07:52 PM
Joined: Aug 2004
Posts: 16
I
Pikka bird
Offline
Pikka bird
I
Joined: Aug 2004
Posts: 16
Hi.

You have already created a dialog which has got a list box?
Let's say, the ID of the list box is 2 and the dialog is named test.
This should list the files in the mirc directory.
(You can replace $mircdir with the an other directory.)

Code:
on 1:DIALOG:test:init:*:{
;this event triggers when you open the dialog "test"
var %f = 1
while ($findfile($mircdir,*,0) >= %f) {
;while %f is lower or equal to the number of files in the mirc directory
did -a $dname 2 $findfile($mircdir,*,%f)
;this adds the filename including its path to your list
inc %f
}
} 


I never use $findfile or something like that, so I dont know wether it works and wether there's an easier way to code this.

I hope that I understood you right.

Kathy


Regards,
KathY
#105494 16/12/04 07:58 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
//!.echo -q $findfile(path,*,0,did -a name id $1-)

Where name identifies the dialog and id is the id number of the control you want to modify.

Example:

//!.echo -q $findfile(c:\,*.txt,0,did -a test 20 $1-)

will add all the files in directory c:\ which have .txt as extension, to a dialog called "test", more specifically in a control which has id number 20.

Greets

Last edited by FiberOPtics; 16/12/04 08:06 PM.

Gone.
#105495 17/12/04 04:06 AM
Joined: Dec 2004
Posts: 12
D
Depodra Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2004
Posts: 12
Both of these worked soundly, tyvm


Link Copied to Clipboard