Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stuck with this Vdbase to Vfp conversion
Message
 
 
To
06/06/2002 16:14:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00665672
Message ID:
00665784
Views:
25
Khan,

If I understand what's going on I'd do this with a couple of SQL commands instead.
select PKCol ;
   from QorM ;
   into cursor DeleteThese nofilter ;
   where 'Dupe' $ ErrFlag1 + ErrFlag2 and DeletFails

delete from QorM ;
   where PKCol in ( select PKCol from DeleteThese )
The actual code could be reduced to delete with the first select as its inner select, but you get a chance to see what's about to be deleted when you split it into two SQLs.

>How to code this in vfp,coz i'm little weak with arrays.txs
>
>
>               * Where there are dupes within a Quarterly <File Type> table
>               * and the user has flagged one of the recs of a dupe set as a
>               * non-error record, delete the other members of the dupe set.
>
>               QIndexKey = key(tagno('CompSSNOEP'),'QorM')
>               set filter to 'Dupe'$ErrFlag1+ErrFlag2.and.QorM->DeletFails
>               count all to N
>               if N>0
>                   set fields to F1=&QIndexKey
>                   GoodDupes = new array(N,1)
>                   copy all to array GoodDupes
>                   set fields to
>                set filter to 'Dupe'$ErrFlag1+ErrFlag2.and..not.QorM->DeletFails
>                   delete for GoodDupes.Scan( &QIndexKey ) > 0
>                endif
>               set filter to
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform