Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting idx files
Message
From
23/02/1998 12:47:51
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00080480
Message ID:
00080490
Views:
21
Yes, your right Garrett. The example I showed you was of a temp table and yeah I guess the code was redundant. Thanks. However, I still have a problem with the indexes I created using SET INDEX TO. After I am done with the cursors I'd like to have the idx files removed otherwise the next time I run a report I get the message asking if I want to overwrite the current idx file. The way you suggested gives me the same error 'File is in use'. Any other tips on how to solve this issue?

>>I am currently running a report, using cursors as the data sources. After the
>>cursors are built, I create an index. When the report is complete I want to
>>remove the cursors and the index, however I am having difficulties removing the
>>index file (IDX).
>
>>IF USED("Probill")
>> SELECT Probill
>> USE
>> DELETE FILE Probill.dbf
>> IF FILE("Probill.idx")
>> DELETE FILE Probill.idx
>> ENDIF
>>ELSE
>> IF FILE("Probill.dbf")
>> DELETE FILE Probill.dbf
>> ENDIF
>> IF FILE("Probill.idx")
>> DELETE FILE Probill.idx
>> ENDIF
>>ENDIF
>
>
>It doesn't look here as if you're using cursors, but rather a temp table.
>If you actually use a cursor (CREATE CURSOR...), and then create a CDX on it, both will be automatically deleted when you stop using the cursor.
>
>Also, your code is redundant. It would be better as:
>
>IF USED("Probill")
> USE IN proBill
>ENDif
>IF FILE("Probill.dbf")
> DELETE FILE Probill.dbf
>ENDIF
>IF FILE("Probill.idx")
> DELETE FILE Probill.idx
>ENDIF
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform