From Xojo Documentation
The number of items in the FolderItem if it is a directory/folder.
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.