Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TMPFILES
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00254693
Message ID:
00254766
Views:
25
A point on temporary files. So long as you are sure your user has room on local hard drive, you never have to name your own temporary files. There are at least three ways to create updateable temporary files (I assume that if they don't get update or at least used as sources in SQL statements that you just use cursor).

1)
* USE THE NOFILTER CLAUSE TO MAKE SURE YOUR CURSOR IS A TEMPORARY FILE, NOT A
*FILTER OR ARRAY For example:

SELECT ALIAS.* FROM ALIAS INTO CURSOR TEMP NOFILTER

*Get the name of the temporary file
lc_temp=DBF()

*USE THE TEMPORARY FILE VFP HAS CREATED AGAIN SO THAT YOU CAN MODIFY IT
USE (lc_temp) AGAIN ALIAS temp2 IN 0

*close the orginal (Read only ) alias
USE IN Temp

*2)create a non-updateable view. Non updatable means that the view does not *change the base tables. You can still do anything you like to the cursor VFP *builds against the viewe.




*3) If you are create a temporary file to populate by means other than sql, *simply use the "create cursor comand.

All of these create temporary tables "behind the scenes" which VFP gets rid of for you when you are through -- so you only have to worry about naming conventions for your aliases rather than physical temporary tables. It is still a great idea to to specify the temporary directory via config.fpw so as to have an easy time cleaning up these temporary files in case an abnormal abort leaves them littering your users hard disk.
Thanks

Gar W. Lipow
Previous
Reply
Map
View

Click here to load this message in the networking platform