The following lines add “valid” folders to a DesktopListBox.
I followed my result in the DesktopListBox and discovers a folder was not reported (I read 118 lines in the DesktopListBox).
Before answering, look at the loop indice start value: 1 in both cases.
There are 119 items in the scanned folder, some are excluded (invisibles and ending with " - Data" a Folder named “Graphics” is excluded too).
The case of the Icon + CR is excluded, I placed all my target items in a brand new folder (and so without custom icon).
If it’s an array it would run from 0 to count - 1. For example if count is 10 it would run from 0 to 9, which is 10 items. Accessing element 10 would result in an out of bounds error as you’ve seen.
You are correct: For Loop_Idx = 0 To Master_Cnt - 1
Works.
So FolderItem(0) = an item from the folder (a difference with API1 where I never used index 0 - it was probably returning the reference of .Parent folder: not what I wanted).
This hurt my eye, but if this is faster, I will try it after a drink.
my data folder was a child (folder) of Downloads
Xojo Applications is the folder where Xojo creates the Debug applications instead of beside the project file).