Hi All.
I am really confused. I am trying to fill in a listbox, with the files in a folder.
Simple enough, right?
Well, when I try the standard
app.theNativePathChosenForVideoFolder = FolderItem.ShowSelectFolderDialog
// how many items are in the folder. For testing only
var howManyItemsAreInThisFolder as Integer
var filesInTheFolderCount as Integer
var theFileNames as FolderItem
howManyItemsAreInThisFolder = (app.theNativePathChosenForVideoFolder.Count)
// for testing only
MessageBox "There are : " + howManyItemsAreInThisFolder.ToString
// fill in the listbox. Why? I have NO IDEA!
For filesInTheFolderCount = 0 To howManyItemsAreInThisFolder -1
System.DebugLog "Files in the folder count = " + filesInTheFolderCount.ToString
windowNewSequentialMoviePlayerVLC.listboxMovies.AddRow (app.theNativePathChosenForVideoFolder.item(filesInTheFolderCount).name)
Next filesInTheFolderCount
// for testing only
If app.theNativePathChosenForVideoFolder <> Nil Then
MessageBox ((app.theNativePathChosenForVideoFolder.ShellPath))
End If
I get an out of bounds error. A system.debug shows it only runs one time for Item 0 in this case.
If I do this:
app.theNativePathChosenForVideoFolder = FolderItem.ShowSelectFolderDialog
// how many items are in the folder. For testing only
var howManyItemsAreInThisFolder as Integer
var filesInTheFolderCount as Integer
var theFileNames as FolderItem
howManyItemsAreInThisFolder = (app.theNativePathChosenForVideoFolder.Count)
// for testing only
MessageBox "There are : " + howManyItemsAreInThisFolder.ToString
// fill in the listbox. Why? I have NO IDEA!
For filesInTheFolderCount = 1 To howManyItemsAreInThisFolder
System.DebugLog "Files in the folder count = " + filesInTheFolderCount.ToString
windowNewSequentialMoviePlayerVLC.listboxMovies.AddRow (app.theNativePathChosenForVideoFolder.item(filesInTheFolderCount).name)
Next filesInTheFolderCount
// for testing only
If app.theNativePathChosenForVideoFolder <> Nil Then
MessageBox ((app.theNativePathChosenForVideoFolder.ShellPath))
End If
It runs perfectly.
I’m confused…
Regards