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:
00791574
Vues:
19
>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

I think FOR loop would be appropriate in this case
lnOccurs = 0
FOR i=1 TO ALEN(laDBFInfo)
  IF laDBFInfo[i,1] = "bob"
    lnOccurs = lnOccurs + 1
  ENDIF
ENDFOR
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform