This content has been marked as final. Show 4 replies
The culprit seems to be ".length". This is at the end of my last line of code.
It is my understanding that the playlist is a Lingo list, and to return the quantity of entities in that list .length is used. I tried a test in a new movie and confirmed that this works.
Any guess how that last trace statement could be affecting any of the functions defined above it?
Does it work better if you use .count instead of .length?
I wrapped everything except for .length in brackets and it no longer produces the error. (see code ONE)
My new problem is the value it's returning. It seems to return 1 no matter what is in the list. I have a few trace statements executing in a looping frame. As you can see, the playlist becomes empty, however the .length continues to return 1. (see code TWO)
Mike, thanks for the direction.
1: .length does not “work”, it simply does not cause the error I was getting. .length keeps returning 1 because I believe it views everything in there as a single entity in an array with length 1. So when I think it is empty, it isn’t. User error.
2: .count works wonderfully. Over time, it returns values I had expected to see as the playlist empties.
Thank you very much for your assistance.