======================================================================
  Microsoft(R) Product Support Services Application Note (Text File)
                       FP0779: ISDISKIN UTILITY
======================================================================
                                           Revision Date: 3/16/93
                                                    Disk Included

The following information applies to Microsoft FoxPro for MS-DOS,
versions 2.0 and 2.5.

 --------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
| accuracy and the use of this Application Note. This Application    |
| Note may be copied and distributed subject to the following        |
| conditions: 1) All text must be copied without modification and    |
| all pages must be included; 2) If software is included, all files  |
| on the disk(s) must be copied without modification [the MS-DOS(R)  |
| utility DISKCOPY is appropriate for this purpose]; 3) All          |
| components of this Application Note must be distributed together;  |
| and 4) This Application Note may not be distributed for profit.    |
|                                                                    |
| Copyright 1993 Microsoft Corporation. All Rights Reserved.         |
| Microsoft and MS-DOS are registered trademarks and Windows         |
| is a trademark of Microsoft Corporation.                           |
 --------------------------------------------------------------------

When a FoxPro program attempts to load a file from a floppy disk and
no disk is present in the drive or the drive door is open, MS-DOS
returns a "Not ready reading drive <letter>" message and provides the
option to "Abort, Retry, Ignore" the error. The ISDISKIN utility is a
binary file provided with the multiuser version of Microsoft FoxPro
versions 2.0 and 2.5 for MS-DOS that provides an alternative method to
deal with this situation. A FoxPro application can call ISDISKIN to
determine the status of the drive and, if necessary, provide a more
appropriate message for the user.

TO USE ISDISKIN IN A FOXPRO PROGRAM
-----------------------------------

1. Insert the enclosed FP0779 disk in your floppy disk drive. (If you
   are using the multiuser version of Microsoft FoxPro version 2.0 or
   2.5 for MS-DOS, you can skip steps 1 and 2.)

2. Copy ISDISKIN.BIN to the C:\FOXPRO2 directory. To do this, type the
   following at the MS-DOS command prompt and press ENTER

      copy <drive:>\isdiskin.bin c:\foxpro2
      
   where <drive:> is the floppy disk drive containing the FP0779 disk.

3. Use "SET DEFAULT TO C:\FOXPRO2" if you are using the single-user
   version of FoxPro version 2.0 or 2.5 for MS-DOS, or "SET DEFAULT to
   C:\FOXPRO2\GOODIES\ADDUSER" if you are using the multiuser version
   of Microsoft FoxPro version 2.0 or 2.5 for MS-DOS.

4. Use the LOAD command to load the ISDISKIN.BIN file. If you are
   using the multiuser version of Microsoft FoxPro version 2.0 or 2.5
   for MS-DOS, ISDISKIN.BIN is installed in the
   FOXPRO2\GOODIES\ADDUSER directory by default.  .

5. Create a character memory variable. Set the variable to the drive
   letter for the disk drive to test. For example, create a memory
   variable called "pvalue" and set it equal to "A:".

6. Use the CALL command to invoke the ISDISKIN.BIN file with the
   character memory variable as a parameter.

ISDISKIN returns one of the following values to indicate the status of
the disk drive:
     
Return Value   Meaning
------------   -------
     A:        Drive A tested and a disk is present in drive A
     B:        Drive B tested and a disk is present in drive B
     0:        (zero) No disk present in the tested drive

SAMPLE PROGRAM
--------------

   * If you are using the multiuser version of FoxPro for MS-DOS, use
   * SETDEFAULT TO C:\FOXPRO2\GOODIES\ADDUSER instead of the following
   * line.
   SET DEFAULT TO C:\FOXPRO2
   LOAD ISDISKIN.BIN
   pvalue = "A:"
   CALL ISDISKIN.BIN WITH pvalue
   DO CASE
   CASE pvalue = "A:"
       RUN DIRECTORY A:
   CASE pvalue = "0:"
       WAIT WINDOW "Please put a disk into drive A:"
   ENDCASE (without the quotation marks)
