Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scanning for repeated records in a table
Message
De
05/03/2007 09:42:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01200695
Message ID:
01200709
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>How would you use scan command to look for repeated records in a table ?

If you take care of array limit you can do something like:
FUNCTION FindDupes(tcAlias)
CREATE CURSOR DupRecs (rec1 i, rec2 i)

SELECT (m.tcAlias)
DIMENSION oRecords[RECCOUNT()]
SCAN
  SCATTER NAME oRecords[RECNO()] memo
ENDSCAN

SCAN
  SCATTER NAME oCurrent memo
  FOR ix = RECNO() + 1 TO ALEN(oRecords)
    IF COMPOBJ( oCurrent, oRecords[m.ix] )
      INSERT INTO DupRecs (rec1,rec2) VALUES (RECNO(m.tcAlias),m.ix)
      INSERT INTO DupRecs (rec1,rec2) VALUES (m.ix,RECNO(m.tcAlias))
    endif
  ENDFOR
ENDSCAN
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform