Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!uthub!koko From: koko@uthub.UUCP Newsgroups: comp.os.cpm Subject: Re: BDOS Search Next Again Message-ID: <588@uthub.toronto.edu> Date: Thu, 17-Sep-87 16:38:17 EDT Article-I.D.: uthub.588 Posted: Thu Sep 17 16:38:17 1987 Date-Received: Sat, 19-Sep-87 05:21:02 EDT References: <330@gaia.UUCP> Organization: CSRI, University of Toronto Lines: 17 Keywords: Still No Luck The problem, as far as I can see, is that the BDOS has internal variables, distinct from the FCB, which are maintained in between the Search for First call and the Search for Next call, and in between successive Search for Next calls. Calls to other file functions overwrite those variables. Therefore the sequence of calls that you are using fails, since your program has no way of saving and restoring those variables -- only BDOS knows where they are stored. The most obvious, but not a very efficient, way of doing what you want to do is to maintain a count of which directory entry you are at. Each time you finish dumping a file, increment that count, then call Search for First, and then call Search for Next the number of times specified by count minus one. (The initial value for count should be one.) Don't forget to reject (and not count) entries that are not the first extension, or else a part of a file will be mistaken for a complete one. If I think of a more efficient way, then I'll post it.