Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!elroy!hacgate!ashtate!dbase!awd From: awd@dbase.UUCP (Alastair Dallas) Newsgroups: comp.databases Subject: Re: dBase question Summary: Don't use LOCATE Keywords: sequential seek Message-ID: <49@dbase.UUCP> Date: 10 Apr 89 20:43:40 GMT References: <6666@bsu-cs.bsu.edu> Organization: Ashton Tate Devlopment Center Glendale, Calif. Lines: 26 In article <6666@bsu-cs.bsu.edu>, mithomas@bsu-cs.bsu.edu (Michael Thomas Niehaus) writes: > I hate to ask questions specific to dBase III+, but I need a quick > answer. > > LOCATE FOR .t. && Just point to the first record to initialize locate > SEEK data-to-be-found && To do a quick move to the records that I want > ...processing... > CONTINUE && To advance to the next record as per the indexed order > > Can anyone tell me if this is a good idea? If not, how would you go about > this? No, this is not a good idea. LOCATE/CONTINUE incurs unecessary overhead when all you need is: SEEK data-to-be-found && To move to the first record you want ...processing... SKIP && To advance to the next record in index order When you SET ORDER to a different database, the meaning of GOTO TOP and SKIP, in particular, is altered to reflect the new ordering. In other words, it does want you want without messing with LOCATE/CONTINUE. Hope it helps. /alastair/