problem removing duplicates from 2d array

# Thread: problem removing duplicates from 2d array

1. Member
Join Date
Dec 1969
Posts
37

## problem removing duplicates from 2d array

Hi there<BR>I am having difficulties with my code below and I cannot understand why.<BR><BR>the problem line is marked with ****<BR>&#039;Subscript out of range&#039;<BR><BR>I can&#039;t see why this may be.<BR>I&#039;d really appreciate any suggestions!<BR><BR>&#060;%<BR>Dim anArray<BR>anArray = RS.GetRows()<BR><BR>dim uniqueArray()<BR>redim preserve uniqueArray(1, 1)<BR>uniqueArray(0, 0)= anArray(0, 0)<BR>uniqueArray(1, 0)= anArray(1, 0)<BR><BR>For I=0 to (UBound(anArray, 2)-1)<BR> <BR>dim result<BR>result=0<BR> <BR>For y=0 to (Ubound(uniqueArray, 2)-1)<BR>result = StrComp(anArray(0, I),uniqueArray(0, y),1)<BR><BR>if (result=0) then <BR> exit for<BR>end if<BR>Next<BR><BR>if(result &#060;&#062; 0)then<BR>****redim preserve uniqueArray((ubound(uniqueArray, 2)+1), 1)<BR>uniqueArray(0, (ubound(uniqueArray, 2)-1)) = anArray(0, I)<BR>uniqueArray(1, (ubound(uniqueArray, 2)-1)) = anArray(1, I)<BR>end if<BR><BR>Next<BR>%&#062;

2. Member
Join Date
Dec 1969
Posts
37

## PROBLEM SOLVED!!!

SILLY MISTAKE SORRY FOR WASTING YOUR TIME!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•