Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change cursor order without changing cursor recno()
Message
 
 
To
10/10/2001 14:02:25
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00566521
Message ID:
00566575
Views:
9
>Larry,
>
>The index on creates a temporary file on the hard drive doesn't it? If I use, I think a sys(2015) call (I have the proper one in another email) to create a unique name, then I need to erase those files on exit, correct? I guess I worry that if the program goes "cafluey" and crashes or the users computer reboots or something, those stray files that didn't get erased because of improper program end, will be left out there in limbo. That is why I am hesitant of writing things I don't need to the hard drive.
>
>Pete

Pete,
Yes it does create a new file on the hard drive. However, all you really need to do is in the initial application load, clean up any files that are left over from the previous sessions.
* get temporary file directory for VFP as this is where the CDXs will be created
* for temporary cursors
close databases all
lctemp = sys(2023)
lcfile = sys(2000,sys(2023)+'\*.cdx')
do while !(lcfile == "")
   delete file (lctemp+'\'+lcfile)
   lcfile = sys(2000,sys(2023)+'\*.cdx')
enddo
This will an infinite loop if a file can't be deleted for some reason. However, since the close database all closes all tables and their indexes, it should work for you.

Note: You don't need to create a unique name as the INDEX ON command does this using the unique name of the cursor returned from the SELECT command.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform