FolderItem.ChildAt

From Xojo Documentation

Method

FolderItem.ChildAt(index As Integer, followAlias As Boolean = True) As FolderItem

New in 2019r2

Supported for all project types and targets.


Returns a FolderItem that represents a file or folder/directory within this FolderItem with the matching index passed.

Notes

Shortcuts and aliases are resolved on all platforms when followAlias is True.

Returns Nil only when some portion of the path to the child does not exist. For example:

SpecialFolder.System.Child("Yummy").ChildAt(0)

will return Nil if:

  • SpecialFolder.System is nil or does not exist
  • the folder "Yummy" does not exist
  • there is nothing in the folder "Yummy"

Example

Get the first file in the Documents folder:

Var docFile As FolderItem = SpecialFolder.Documents.ChildAt(0)