Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting idx files
Message
 
To
23/02/1998 12:22:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00080480
Message ID:
00080488
Views:
27
>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
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform