goran187 wrote:

I am trying to go through the rows of a dataProvider and make sure there are no duplicate records. Do you know of an easy way to do this (maybe a built in function?)

Use a hash table. AS2 objects are like hash tables.

var uniqueItems = {};
for (var i:Number = 0; i < myDataProvider.length; i++)
{
var item = myDataProvider.getItemAt(i);
uniqueItems[String(item)] = item;
}

Now you can iterate through the values to get the unique items. The code assumes that identical items have identical string representations.

Manish




Reply via email to