FolderItem.Count
From Xojo Documentation
Read-Only Property (As Integer )
The number of items in the FolderItem if it is a directory/folder.
Notes
Avoid calling this function several times as it is costly in processing time and will have poor performance.
Especially avoid calling it repeatedly in a loop. Instead, get its value once and store it in a variable for further use.