Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25584
| Subject | Re: Foxpro goto command and deleted records |
|---|---|
| From | Ed Leafe <ed@leafe.com> |
| Date | 2012-07-18 12:28 -0500 |
| References | <5005EDC0.6050608@stoneleaf.us> <8416AFAF-E201-4F89-B306-D89F920A00FE@leafe.com> <5006F0F7.8030004@stoneleaf.us> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2275.1342632540.4697.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Foxpro goto command and deleted records Ed Leafe <ed@leafe.com> - 2012-07-18 12:28 -0500
csiph-web