<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 15 Sep 1987 20:52:36 GMT
From   : hao!gaia!cook@husc6.harvard.edu (Forrest Cook)
Subject: BDOS Search Next Again

Thanks to all of the responses to my first question about the
BDOS Search for First and Search for Next commands.  Most of the
messages I received said that it is necessary to do the Search
Next calls immediately after the Search First, and to save the
filenames and/or FCBs in a buffer before doing any file operations.

I have changed my code and seem to be back to square one.
The procedure I am using is now as follows:

Zero the lower FCB bytes and the CR byte in the FCB (as per cp/m manuals).
Fill the name and extension fields with ???????? and ???   .
Call Search for First with DE pointing to the FCB.
Call Search for Next. (This doesn't help or hurt.)
Call a routine which copies the FCB to another buffer NEWFCB.
Open, Read, and Close the first file using NEWFCB, FCB is not altered.
Call Search for Next. (I tried pointing DE to the FCB, no change.)

The results: The search first returns with the first filename and the file
is read out with no problems.  The search next returns with the first filename
and the read bombs out with an immediate EOF.  The search for first and next
both return without errors (match found).

Am I missing somthing very obvious?

Thanks in advance,
Forrest Cook
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>