Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search an Array for duplicates
Message
 
To
22/05/2003 09:13:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00791559
Message ID:
00794158
Views:
16
Hi Amanda. I know that Nick already recommended stuffing the array into a table and then SELECTing from it. But actually, you can skip a step if you use COPY STRUCTURE EXTENDED. This creates a table with field info, including a field called FIELD_NAME, which you can select against.

Might be easier than afields(), create table, and copy from array.

However, COPY STRU EXTENDED creates a table, with a disk presence. So, I'd be hesitant to favor this approach in a production environment, because you will need to name it uniquely, clean it up, and so on. But, perhaps it will still help....






>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
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform