Hi,
After a multisort function, I have an array:
[3][IDnum] = ID03
[5][IDnum] = ID18
[6][IDnum] = ID27
[2][IDnum] = ID39
[4][IDnum] = ID39
[0][IDnum] = ID452
[1][IDnum] = ID890
there's also a [dup] element, all = 'No'
I want to write a while loop to scan this array.subelement, IDnum and find the two ID39 duplicates like this. When dups are found set the [dup] element to 'Yes'
Some pseudocode......
$i=0
start at top of sorted array (row [3])
$a = IDnum
skip one row
while ( $i <= the last row)
$b = IDnum
if $a = $b {
set the [dup] element of the current row = 'Yes'
skip one row backward
set this row's [dup] element = 'Yes' also
skip forward one row again
}
$a = $b (swap vars for the next $a)
skip another row (move to next row for next $b)
increment i
endwhile (loop and start again with another $b)
how do you "start at the top of the current array" if my number element is not in order anymore?
how do you "skip" to the next row in the array?
thanks! :rolleyes:
mojo