Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete and Packing not working - pls help
Message
 
 
À
03/07/2002 03:05:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00671523
Message ID:
00675194
Vues:
13
Is there any reason you're using DO WHILE instead of SCAN?
With DO WHILE there're two things missing in your code:
1. GO TOP right before DO WHILE, otherwise processing will start from the current record not from the beginning of the table. If MyList table is at EOF then nothing will be processed at all.
2. Selecting MyList and SKIP right before ENDDO to move to the next records.

Also, I don't see any connection between MyList table and processing.

>Hi,
>
>My code is like something below, insteads of purging and packing my
>file, it just ignore it and go to the end like nothing had happened.
>I am sure that my file is not open or use by other in the process.
>
>
*--sb--
GO TOP
>WHILE NOT EOF("MyList")
>
>  IF FILE("xx.dbf")
>       USE xx.dbf EXCLUSIVE
>       IF USED("xx") AND ISEXCL("XX")
>             SELECT xx
>             DELETE ALL FOR CLOSING = pvClosing
>             PACK
>       ENDIF
>  ENDIF
>
>  IF FILE("yy.dbf")
>       USE yy.dbf EXCLUSIVE
>       IF USED("yy") AND ISEXCL("yy")
>             SELECT yy
>             DELETE ALL FOR CLOSING = pvClosing
>             PACK
>       ENDIF
>  ENDIF
>
> Messagebox("All purging done")
>
*--sb--
   SELECT MyList
   SKIP
>ENDDO
>
>
>
>
>>Hi Virusm,
>>
>>Can you provide more details, post some relevant code?
>>
>>>Hi,
>>>
>>>I had a VFP5 written application that just open some
>>>dbf file in exclusive mode, delete some record, pack it.
>>>
>>>All this is done in a while loop until the master record is from a file list where it will indicate which file to delete and pack.
>>>
>>>However, when I run my application, it is running fine without any error,
>>>but don't pack or delete my dbf file.
>>>
>>>But when I add some delay like WAIT '' TIMEOUT 2 command, it actually
>>>delete and pack my application.
>>>
>>>I am running on win2000.
>>>
>>>What is causing this problem, please kindly advise and help.
>>>Thank a lot.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform