Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Altering a CUSOR's structure
Message
From
01/12/1997 15:01:43
 
 
To
01/12/1997 14:34:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00062738
Message ID:
00063114
Views:
67
>>>>Interesting approach. I still don't see how to guarantee that the TMP file returned by DBF() exists. Isn't it possible to get back a file name for the TMP file that VFP will create when the cursor becomes too large to fit in memory? If I could guarantee that the cursor would have a disk presence, then your approach would solve my problem.
>>>
>>>Edwin,
>>>
>>>A cursor created with CREATE CURSOR always has a disk presense. Cursors created by sql select may be filtered versions of the original table, but create cursor always creates a dbf on in the temp directory.
>>>
>>>The question that I have is, if you are creating the cursor why do you need to change its structure, why create it with the right structure in the first place?
>>
>>Jim:
>>
>>True, any cursor created with CREATE CURSOR will (under LIST STATUS) show up as a .tmp file in the TEMP directory. But if you open Explorer and look at the TEMP directory, you will not always see that cursor's filename. In that case, VFP (I think) just keeps the cursor in memory.
>
>I think the best way to prove (or disprove) it, is trying to run Select * From tmpalias. That's the command which should catch the difference. Actually, I didn't check the thread from the beginning and don't understand practical reason for all this stuff :) In regard to 'modifying cursor structure', I think it's consistent enough to close cursor (USE) and start new one with CREATE CURSOR.

Hi Ed:
It would help to look at the thread. This part is really a side issue. The idea is to use cursors as a view into data. The cursors will be bound to controls. It would be useful to be able to modify the cursor structure with as little disturbance to the bound controls as possible.

One problem with your approach is that if the cursor is the record source of a grid, special care has to be taken that it doesn't notice that its record source is gone. If the structure is altered in place, adding a field to the cursor should not cause any problems. Other types of bound contorls could also be a problem. Of course, if a field is removed even the new approach would get more complicated.

Thanks
Ned

Reality is.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform