<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 17 Sep 1987 20:38:17 GMT
From   : clyde!watmath!utgpu!utcsri!uthub!koko@rutgers.edu (M. Kokodyniak)
Subject: Re: BDOS Search Next Again

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.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>