Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.python

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2012, 02:57 AM
MRAB
Guest
 
Posts: n/a
Default Re: Foxpro goto command and deleted records

On 18/07/2012 03:19, Ethan Furman wrote:
> MRAB wrote:
>> On 17/07/2012 23:57, Ethan Furman wrote:
>>> In Foxpro if you do a
>>>
>>> GOTO 7
>>>
>>> with deleted off and record 7 is deleted, the record pointer doesn't
>>> move (at least in version 6).
>>>
>>> I don't like that.
>>>
>>> I see four other options:
>>>
>>> 0) don't move the pointer (listed for completeness)
>>> 1) go to that record anyway
>>> 2) go to the next undeleted record
>>> 3) go to the seventh undeleted record (possibly the least practical)
>>> 4) raise an exception
>>>
>>> Any opinions?
>>>

>> What happens when you 'delete' a record? Does it disappear immediately,
>> or is it merely marked for deletion?

>
> Marked for deletion.
>
>> If it is marked for deletion, can it be unmarked? Will a marked record
>> be removed when the file is closed, or does the file need to be
>> explicitly purged/compacted?

>
> Yes, it can be unmarked. No, the table must be explicitly packed.
>
>> If it is merely marked, then I think the best option is 1, or possibly
>> 4 if the file is compacted when closed.

>
> There is a use_deleted setting that controls whether deleted records are
> accessed or skipped. Skipping is fine when looping, not so fine when
> going directly to a particular record.
>

If use_deleted is false, does that mean that deleted records are
hidden, or just that when iterating through the records the deleted
ones aren't yielded?
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 03:20 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.