[MX] Skipping duplicate records

Hallo there!

I’m creating a dynamically generated list using a for while loop, and I created an if this record equals last record, continue on and leave it weeping in the dust like a sad child who dropped their ice cream cone. Here is the code:

[AS]for (i=0;i<someWDDXData.getRowCount();++i){
city = someWDDXData.Record*
if (previousCity == city){
++i;
}
name = “cityText” + i;
cityMenu.cityList.attachMovie(“cityText”, name, n);
spacing = cityMenu.cityList[name].item._height;
y = spacing * a;
cityMenu.cityList[name]._y = y;
cityMenu.cityList[name].item.text = someWDDXData.Record*;
previousCity = someWDDXData.Record*;
n = ++n;
a = ++a;
}[/AS]

But alas! Something isnot right, and in the end, it is I who weeps like the child :*(

When I run it, it will catch the first duplicate, but in instances where I have 3 or more, it catchesonly the first, and after that laughs at me from behind it’s thick glass shield (in this case, the monitor).

Any advice?

Thanks in advance! :hat:

lrhb