I’m getting an outofBounds exception with the example code for DelEntireFolder found in FolderItem.Remove.
The Code:
For i As Integer = 1 To itemCount
Var f As FolderItem
f = theFolder.ChildAt(i)
If f <> Nil Then
If f.IsFolder Then
dirs.AddRow(f)
Else
files.AddRow(f)
End If
End If
Next
I think the problem is between theFolder.Count
and theFolder.ChildAt
Count starts at 1 and theFolder.ChildAt
which uses index so it starts at 0.
From the LR:
FolderItem.ChildAt(Index as Integer, followAlias as Boolean = true) As FolderItem
I also tracked the files being added to the files array and it missed the first file.
I am posting this because I am forever overlooking count and index. It would be nice to know I didn’t .
Did I finally see Count correctly?