Difference between revisions of "FolderItem.Children"

From Xojo Documentation

(Examples)
Line 15: Line 15:
 
This example adds the names of all the files on the desktop to a listbox:
 
This example adds the names of all the files on the desktop to a listbox:
 
<rbcode>
 
<rbcode>
Var DesktopFiles as folderitem = SpecialFolder.Desktop
+
Var DesktopFiles As FolderItem = SpecialFolder.Desktop
for each file as folderitem in DesktopFiles.Children
+
For Each file As FolderItem In DesktopFiles.Children
   Listbox1.AddRow(file.name)
+
   Listbox1.AddRow(file.Name)
 
Next
 
Next
 
</rbcode>
 
</rbcode>
  
 
[[Category:API 2.0]]
 
[[Category:API 2.0]]

Revision as of 17:24, 12 November 2019

Method

FolderItem.Children(followAlias as Boolean = True) As Iterable

New in 2019r2

Supported for all project types and targets.

Allow you to iterate through all the files in a folder.

Examples

This example adds the names of all the files on the desktop to a listbox:

Var DesktopFiles As FolderItem = SpecialFolder.Desktop
For Each file As FolderItem In DesktopFiles.Children
Listbox1.AddRow(file.Name)
Next