|
-
Dec 10th, 2000, 10:21 PM
#1
Thread Starter
New Member
Somehow I am not able to do the following.
Delete any duplicate numbers out of a small one dim.array.
The numbers are no more the 5 digits in length and the array is not sorted nor does it have to be.
I just want to remove the duplicate numbers..
Thanks in advance..
Trent
-
Dec 10th, 2000, 10:35 PM
#2
Fanatic Member
Is there a fixed amount of elements in your array or can it be redimensioned??
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Dec 10th, 2000, 11:17 PM
#3
Thread Starter
New Member
It was set up dynamic as:
Dim rpp() As Integer
Then set up like this once I knew how many records I was going to process..
ReDim Preserve rpp(intrecCount)
-
Dec 10th, 2000, 11:35 PM
#4
Fanatic Member
As a suggestion, why don't you creat a new array and go through each item of your old array and only add it to the new array if it doesn't already exist.
-
Dec 11th, 2000, 12:50 AM
#5
transcendental analytic
Is the range of the values small? If you have a reasonable amount, then you could create a value table and then make a single loop checking for each value and then start copying the values over larger intervals backwards each time you find a duplicate. It's a lot faster than going trough the loop over and over again.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|