lrhb
October 13th, 2003, 07:26 PM
Hello!
I'm working on a small validation script, to check elements of a data object for duplicates... it goes a little something like this (hit it!):
for (i=0;i<_root.wddxData.getRowCount();++i){
city = _root.wddxData.ADDRESSCITY[i];
if (previousCity == city){
trace(city+" IS A DUPLICATE"); }
[...]
previousCity = city;
}
It works well enough, and goes through the recordset and tells me when there's duplicates... but what I tried didn't work. i thought if I did:
if (previousCity == city){
i = ++i; }
and continued my loop, it would work, but instead, it would catch the first duplicate, but miss the rest after that.
Basically what I'd like to do is simple: If this record[i] is equal to record[i+1], skip record[i+1] and go through it again... I just can't seem to figure it out :hat:
Advice, as always, appreciated!
ever curious,
lrhb
I'm working on a small validation script, to check elements of a data object for duplicates... it goes a little something like this (hit it!):
for (i=0;i<_root.wddxData.getRowCount();++i){
city = _root.wddxData.ADDRESSCITY[i];
if (previousCity == city){
trace(city+" IS A DUPLICATE"); }
[...]
previousCity = city;
}
It works well enough, and goes through the recordset and tells me when there's duplicates... but what I tried didn't work. i thought if I did:
if (previousCity == city){
i = ++i; }
and continued my loop, it would work, but instead, it would catch the first duplicate, but miss the rest after that.
Basically what I'd like to do is simple: If this record[i] is equal to record[i+1], skip record[i+1] and go through it again... I just can't seem to figure it out :hat:
Advice, as always, appreciated!
ever curious,
lrhb