[Gambas-user] Useing ListView to List a Dir?

Mike Keehan mike_keehan at ...679...
Tue Aug 16 13:25:42 CEST 2005


Steve Starr wrote:
> I found this code on gambas mailing list.
> I was wondering what would i have to change adout this code to have it
> list my /home/comtux directory?
> 
> PUBLIC SUB Form_Open()
>  DIM sPath AS String
>  DIM sDir AS String
>  
>  FOR EACH sDir IN Dir(sPath, "*")
>  ListView1.Add(sPath &/ sDir, sDir)
>  NEXT
> 
> END
> 
> Thanks for any replys
> 

You need to set sPath to the name of your directory:-

   sPath = "/home/comtux"

Have a look at the example called Explorer - you can find it from the 
menu under  File/Open example/Miscellaneous/Explorer.

Mike.





More information about the User mailing list