Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete
Message
De
04/08/2008 14:13:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Delete
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01336237
Message ID:
01336301
Vues:
10
>>>>SET DELETED ON
>>>>
>>>>txtPathName = "DADOS\ECT\" + "ECT" + CHRTRAN(DTOC(DATE()),"/","") + ".TXT"
>>>>= MESSAGEBOX (txtPathName)
>>>>SET SAFETY OFF
>>>>COPY FILE (anxFullPth) TO (txtPathName)
>>>>SELECT pgreembolso3
>>>>DELETE ALL
>>>>append FROM (txtPathName) type SDF && till here records are appended OK
>>>>set safe on
>>>>SELECT pgreembolso3
>>>>
>>>>Now I need to delete the first record , because its the header
>>>>
>>>>BROW
>>>>GOTO 1
>>>>DELETE
>>>> PACK
>>>>BROW ---- first record still there
>>>
>>>NO WAY!
>>>After PACK all deleted records should disappear.
>>>
>>>
>>>SET DELETED ON
>>>
>>>txtPathName =  "DADOS\ECT\" + "ECT" + CHRTRAN(DTOC(DATE()),"/","") + ".TXT"
>>>= MESSAGEBOX (txtPathName)
>>>SET SAFETY OFF
>>>COPY FILE (anxFullPth) TO (txtPathName)
>>>SELECT * FROM pgreembolso WHERE .f. INTO CURSOR pgreembolso3 READWRITE
>>>
>>>SELECT pgreembolso3
>>>append FROM (txtPathName)  type SDF  && till here records are appended OK
>>>SELECT pgreembolso3
>>>BROW
>>>GOTO 1
>>>DELETE
>>>PACK
>>>GO TOP
>>>BROW
>>>
>>Check Moises' code, and you will see that he first DELETE ALL, then he APPENDs, then he DELETEs the first record which is already deleted...! After the first DELETE ALL he has forgotten to PACK. Nevertheless he uses a zillion lines to do something which could be done in two lines.
>
>O! Sh.....t!
>:-)
>You are right of course.

I guess I have a better Monday than someone else today! :-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform