wb1j+@andrew.cmu.edu (William M. Bumgarner) (10/24/88)
I'm writing XCMD/XFCN's to control an Apple CD-ROM player. Currently, to get the refNum, I call OpenDriver(".AppleCD", &refNum); at the beginning of each XCMD/FCN... Do I need to do this, or is there a way to leave it open and get the refNum at the beginning of the code unit w/o re-opening. If I do use the OpenDriver to do so (this may be advantageous in certain situations), do I need to CloseDriver at the end of the unit? thank you, b.bum wb1j+@andrew.cmu.edu
rj0z+@andrew.cmu.edu (Robert George Johnston, Jr.) (10/24/88)
I believe that OpenDriver, when called, will not re-initialize a device if it is already opened. At least, the driver should have been written to only open one. You should leave it open if you are planning on calling your routine that opens and closes it often, and write a small routine that just closes it. The close routine could be called from the program, when it knows that its done with the driver. Rob Johnston.