Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search an Array for duplicates
Message
 
À
22/05/2003 09:13:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00791559
Message ID:
00791584
Vues:
40
>I need to search an array for duplicates. I have been using ASCAN thusly to find a string,
>
>ascan(laDBFInfo,'bob',1,lnFieldNumber,1,1)
>
>Now, my ascan finds 'bob', but I want to know if 'bob' occurs more than once in the array. A count of the occurances of 'bob' would solve my issue. Any ideas?
>TIA

If you need a list of all duplicate words in the array (not the specific ones) you also could convert the array into a table and run SQL statement against it.
Something like:

* convert the array into the table here
SELECT mywords, count(mywords) group by mywords having count(mywords) > 1
where mywords is a table column converted from your array column that contains names.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform