From: Gary K. <gbo...@ya...> - 2005-11-07 18:08:38
|
Hey Denis Glad Xbase is working for you!!! Try xbNdx.GetFirstKey(); GetNextKey(); GetLastKey() and GetPrevKey(); See program sample5.cpp for more info. Gary --- Denis Brown <ds...@cy...> wrote: > Dear List, > > I am happy to have found and be using Xbase 2.0.0 on > Debian GNU/Linux > :-) And I thank the developers for what seems to > be a highly valuable > resource!! I used to do a bit of coding in dBASE-II > on CP/M machines so > maybe my ideas are outdated! Herewith the query... > > In a dBASE-II context if I have a database "mydata" > and an index file > "myindex", I can have my records output in sorted > order (index order) by > using a statement such as > USE mydata INDEX myindex > > If I do what I *think* is the equivalent in Xbase, I > seem to only get > records in physical, not logical (indexed) order. > Am I doing something > wrong, or do I have the wrong idea about the Xbase > code? I presume that I > can find, based on keys (have not tried that yet) > and so that Xbase's > indexing logic may be fine, and my thinking is out > of whack. A sample of > my code follows... > > Thanks in advance (and Greetings from Australia), > Denis > > (preamble snipped, error testing omitted) > MyData.OpenDatabase ("mydata.dbf"); > MyIndex.CreateIndex("myindex.ndx","filed1",XB_NOT_UNIQUE,XB_OVERLAY); > MyIndex.ReIndex(); > > Now I would expect that MyFile.GetFirstRecord() > would return the record > with the lowest index for the field I have indexed > on. Then, > MyFile.GetNextRecord() would return the next higher > index and so on. > > But what seems to be happening is that regardless of > indexing, the physical > record numbers (and records in the file) are > appearing. > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's > Geronimo App Server. Download > it for free - -and be entered to win a 42" plasma tv > or your very own > Sony(tm)PSP. Click here to play: > http://sourceforge.net/geronimo.php > _______________________________________________ > XDB-users mailing list > XDB...@li... > https://lists.sourceforge.net/lists/listinfo/xdb-users > __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com |