Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25584 > unrolled thread

Re: Foxpro goto command and deleted records

Started byEd Leafe <ed@leafe.com>
First post2012-07-18 12:28 -0500
Last post2012-07-18 12:28 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Foxpro goto command and deleted records Ed Leafe <ed@leafe.com> - 2012-07-18 12:28 -0500

#25584 — Re: Foxpro goto command and deleted records

FromEd Leafe <ed@leafe.com>
Date2012-07-18 12:28 -0500
SubjectRe: Foxpro goto command and deleted records
Message-ID<mailman.2275.1342632540.4697.python-list@python.org>
On Jul 18, 2012, at 12:16 PM, Ethan Furman wrote:

> Your memory is good!  I typed it in wrong.

	Well, I was an MVP for Visual Foxpro for 10 years, so... 

	;-)

> 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
> 
> I still don't like it.  Any opinion on the other four choices?  I'm leaning towards 1, possibly with 4 as an option:

	#4 is probably the most Pythonic approach. The calling code can then decide how to react to attempting to access a deleted record. Even if you're accessing data stored in VFP tables, your module should be as Pythonic as possible.

> Part of the reason I feel this is reasonable is that with my dbf module it is possible to create an index that does /not/ include certain records:

	Deleting a record in VFP doesn't remove it from the index; I believe it marks that index entry as deleted, too. I think that as long as you treat the deleted status as the same as any other boolean column you'll be good.


-- Ed Leafe


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web