[Gambas-user] How do I fetch a list of files?

Bodard Fabien gambasfr at ...11...
Thu Mar 3 00:05:14 CET 2005


Le mercredi 2 Mars 2005 22:00, Ron Onstenk a écrit :
> On Tuesday 01 March 2005 13:39, Bodard Fabien wrote:
> > Le mardi 1 Mars 2005 07:25, Eldon Eller a écrit :
> > > Yet another dumb question (YADQ): I am writing a gambas app where I
> > > want the user to select from a list of files (not via a dialog). So I
> > > need a way to fetch the file names from a specified directory. How do I
> > > do that?
> >
> > Look at fill_explorer in the gambas ide in the FSupExplorer class
> >
> > dim sDir as string
> > For each sDir in Dir(sPath, "*")
> > ListView.Add(sPath &/ sDir, sDir)
> > Next
> >
> > Gambas power ;)
> >
> > Fabien Bodard
>
> If I remeber well then next does also the job.
>   ListView.List = Join( Dir(sPath, "*") , ";" )
> Can be "\n" instead of ";"
>ron
you're right... but listview look better with picture ;-)
dim sDir as string
For each sDir in Dir(sPath, "*")
ListView.Add(sPath &/ sDir, sDir, Picture["file.png"])
Next
Regards,
Fabien





More information about the User mailing list