AlpVir Well-Known Member Licensed User Longtime User Sep 12, 2013 #1 1) How to count the number of jpg files in a folder that can contain other types of files? 2) How to count the number of files in a folder? thanks in advance
1) How to count the number of jpg files in a folder that can contain other types of files? 2) How to count the number of files in a folder? thanks in advance
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2013 #2 B4X: Dim c As Int = 0 For Each f As String In File.ListFiles(File.DirRootExternal) If f.EndsWith(".jpg") Then c = c + 1 Next Log(c) Upvote 0
B4X: Dim c As Int = 0 For Each f As String In File.ListFiles(File.DirRootExternal) If f.EndsWith(".jpg") Then c = c + 1 Next Log(c)
AlpVir Well-Known Member Licensed User Longtime User Sep 12, 2013 #3 Perfect !!! I thought, however, that there was an statement type TotFiles = f.lenght or similar. thanks Upvote 0
Perfect !!! I thought, however, that there was an statement type TotFiles = f.lenght or similar. thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2013 #4 File.ListFiles returns a List. List.Size will return the total number of files. Upvote 0