forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


List help with filenames.

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Tue Sep 09, 2003 11:31 am    Post subject: List help with filenames. Reply with quote

I have a list and i can fille the list with files from my dir, but i dont want to show the paths. How can i make it so only filenames show in my list?
I tried the @name with the filelist command, but i cant seem to get it to work.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Sep 09, 2003 12:23 pm    Post subject: Reply with quote

You are close.
You will have to create a new list then fill the list with the files using the @name() function. Here is an example:

Code:

list create,1
list create,2
list filelist,1,C:\MyFiles\*.*
%x = 0
repeat
 list add,2,@name(@item(1,%x))"."@ext(@item(1,%x))
 %x = @succ(%x)
until @equal(%x,@count(1))
info @text(2)
list close,1
list close,2


I haven't tested it, but, this should work

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Tue Sep 09, 2003 1:47 pm    Post subject: Reply with quote

Thank you, thats did it.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Tue Sep 09, 2003 7:39 pm    Post subject: Reply with quote

Change directory to the directory where you want to list the files, then fill the list with the filelist

Code:
  list create,1
  %%CurDir = @curdir()
  Directory Change,C:\MyFiles
  list filelist,1,*.*
  Directory Change,%%CurDir
  list close,1

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Sep 09, 2003 7:51 pm    Post subject: Reply with quote

Yeah, that too. Wink
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Tue Sep 09, 2003 10:08 pm    Post subject: Reply with quote

Use the winapi LB_DIR message:

%A = @sendmsg(@win(~LIST1),$018D,2,@windir()\*.*)


Here is an example
Code:

title TEST
DIALOG CREATE,TEST,-1,0,213,215
DIALOG ADD,BUTTON,BUTTON1,170,70,,,,,DEFAULT
DIALOG ADD,LIST,LIST1,10,12
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
%A = @sendmsg(@win(~LIST1),$018D,2,@windir()\*.*)
rem Shows all files from @windir()\ in list1, change @windir()\*.* to the
rem directory and the *.* filetypes you want to show
goto evloop
:CLOSE
exit
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group