Talk:ISDBSongList::Delete: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 6: Line 6:


For x = 0 to sdbsonglist.count-1
For x = 0 to sdbsonglist.count-1
  if sdbsonglist.item(x).rating < 50 then
  if sdbsonglist.item(x).rating < 50 then
   sdbsonglist.delete(x)
   sdbsonglist.delete(x)
Line 13: Line 12:


that is a realistic situation when you are checking a track list for certain criteria (ie rating etc) and you want to remove a track without creating a new secondary songlist object.
that is a realistic situation when you are checking a track list for certain criteria (ie rating etc) and you want to remove a track without creating a new secondary songlist object.
--[[User:Teknojnky|Teknojnky]] 23:03, 4 February 2008 (EST)

Revision as of 04:03, 5 February 2008

What is the best way to use this method?

If I try to delete a track within a loop, the loop does not get the updated .count and it will go out of bounds..

example:

For x = 0 to sdbsonglist.count-1

if sdbsonglist.item(x).rating < 50 then
  sdbsonglist.delete(x)
end if

Next

that is a realistic situation when you are checking a track list for certain criteria (ie rating etc) and you want to remove a track without creating a new secondary songlist object. --Teknojnky 23:03, 4 February 2008 (EST)