Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Thu May 22, 2008 11:39 pm   

directory listing
 
I checked the help files in and out and can't seem to find a #COMMAND that gives you a directory listing.

Currently I am using #PICK to show a list of selected files, but that can turn out to be HUGE and eventually I would have to use multiple #PICKs depending on the amount of files I would be using.

Did I miss a #COMMAND somewhere? or is there a way I could call a windows thread or CMD directory and return it to zMUD? Not sure if #DDE would help as I am not sure if there are any windows 'programs' that I could use that with.

Basically I am looking for a %function or #COMMAND that will allow me to return a file name from a directory list.

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri May 23, 2008 12:43 am   
 
Doesn't exist. You could try using JScript, VBScript or COM to do this - I'm not sure how you'd go about it, but I assume it's possible.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri May 23, 2008 6:48 pm   
 
If you're using XP or Vista then probably something like this.

Code:
#VAR DLG %comcreate("UserAccounts.CommonDialog")
Dlg.InitialDir = "C:\SomeValidDirectory"
#VAR FileName {}
#IF (@Dlg.ShowOpen()) {#VAR FileName @Dlg.FileName}
#NO do something with FileName here



EDIT: not sure if that works on Vista, I tried a JScript equivalent on XP.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Sat May 24, 2008 1:12 am   
 
Awesome, that's exactly what I am looking for. Is there anyway to put in a filetype, like *.txt, or *.exe with that?

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Sat May 24, 2008 9:59 am   
 
I guess something like
Code:

...
Dlg.InitialDir = "C:\SomeValidDirectory"
Dlg.Filter = "Text Files|*.txt|All Files|*.*"
...


Entries in .Filter are
-A text description for you to read when dialog will pop up (Text Files).
-The pipe separator (|)
-The actual filter itself (*.txt)

Add as many file types to the filter as you want
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Sat May 24, 2008 4:34 pm   
 
Thanks, awesome job guys.

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net