Difference between revisions of "FolderItem.Children"

From Xojo Documentation

m
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
| ownertype=class
 
| ownertype=class
 
| scope=public
 
| scope=public
| parameters=resolveAlias as [[Boolean]]
+
| parameters=followAlias as [[Boolean]] = True
 
| returntype=[[Iterable]]
 
| returntype=[[Iterable]]
 
| platform=all
 
| platform=all
Line 10: Line 10:
 
}}
 
}}
 
{{Description
 
{{Description
|text = Allow you to iterate through all the files in a folder.}}
+
|text = Allows you to iterate through all the files in a folder.}}
  
 
==Examples==
 
==Examples==
 
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]]

Latest revision as of 20:43, 3 December 2019

Method

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

New in 2019r2

Supported for all project types and targets.

Allows 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