The code below was borrowed off the forum, by T.J Tigger originally. And it works as it should except I cannot import more than around 615 files into the listbox. Much more than that and it returns empty handed.
A non-random code has no such limitation. I'm hoping someone here can figure out whats causing the restriction.
Any help would be appreciated.
A non-random code has no such limitation. I'm hoping someone here can figure out whats causing the restriction.
Code:
-- Get your list of files. PlayList = Dialog.FileBrowse(true, "Load Videos", "", "", "", "", true, true); if PlayList then --If there are songs in the table then proceed -- Count the soungs found songCount = Table.Count(PlayList); -- display the number of songs found Dialog.Message("Count","There are " ..songCount .." files added"); -- for each song found we will do the following for x=1,songCount do --Generate a random number between 1 and the table count rndnum = Math.Random(songCount); --Split the song path using the random number tblSong = String.SplitPath(PlayList[rndnum]); -- Add the song to a listbox ListBox.AddItem("ListBox1", tblSong.Filename , PlayList[rndnum]); -- Remove the added item from the table Table.Remove(PlayList, rndnum); -- get a new table count on the PlayList Table. songCount = Table.Count(PlayList); end end
Comment