Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!gaia!cook From: cook@gaia.UUCP (Forrest Cook) Newsgroups: comp.os.cpm Subject: BDOS Search Next Again Message-ID: <330@gaia.UUCP> Date: Tue, 15-Sep-87 16:52:36 EDT Article-I.D.: gaia.330 Posted: Tue Sep 15 16:52:36 1987 Date-Received: Thu, 17-Sep-87 06:02:12 EDT Organization: Gaia Corp, Boulder, CO Lines: 26 Keywords: Still No Luck 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