Foxpro goto command and deleted records

Ed Leafe ed at leafe.com
Wed Jul 18 19:28:58 CEST 2012


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






More information about the Python-list mailing list