[Gambas-user] rdir returns unwanted directories

Tobias Boege taboege at ...626...
Sun May 28 17:40:53 CEST 2017


On Sun, 28 May 2017, Charlie wrote:
> I presume you just want the file name not the folder details. If so try this,
> sFiles will contain just the file name: -
> *Public Sub Form_Open()
> Dim sFileArray As New String[]
> Dim sFiles As New String[]
> Dim sTemp As String
> sFileArray = RDir(User.Home, "*", gb.File) 
> For Each sTemp In sFileArray
>   sFiles.Add(Mid(sTemp, RInStr(sTemp, "/") + 1))
> Next
> End*

Instead of Mid(sTemp, RInStr(sTemp, "/") + 1) you may want to use the
appropriately named function File.Name(sTemp).

Still, using RDir(..., "*", gb.File) only gives me files, no directories,
so I can't reproduce your original problem here.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list