home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / fdrvcnt.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  2KB  |  73 lines

  1. /*
  2.  * File......: FDRVCNT.C
  3.  * Author....: Dave Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 30/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. // NOTE: This code has been written for and compiled with Borland C++
  21. //       Version 3.1
  22. //
  23.  
  24. #include "gt_mem.h"
  25. #include <Extend.H>
  26.  
  27. /*  $DOC$
  28.  *  $FUNCNAME$
  29.  *      GT_FLOPCNT()
  30.  *  $CATEGORY$
  31.  *      Disk Drive
  32.  *  $ONELINER$
  33.  *      Return a count of the floppy drives on a system.
  34.  *  $SYNTAX$
  35.  *      GT_FlopCnt() --> nNumberOfDrives
  36.  *  $ARGUMENTS$
  37.  *      None.
  38.  *  $RETURNS$
  39.  *      The number of physical floppy drives fitted to a machine.
  40.  *  $DESCRIPTION$
  41.  *      GT_FlopCnt() can be used to check if a system has more than one
  42.  *      floppy drive.
  43.  *
  44.  *      Some systems have just one floppy drive that can ``act'' as either
  45.  *      drive A: or B:. If your system attempts to access either of these
  46.  *      drives while it is ``acting'' as the other, DOS will display a
  47.  *      message in screen asking the user to place the disk in the drive
  48.  *      and press any key.
  49.  *
  50.  *      Use GT_FlopCnt() to see if this could be a problem. If the machine
  51.  *      has only one floppy drive, use GT_FlopNam() to see if the floppy
  52.  *      drive is acting as A: or B:.
  53.  *  $EXAMPLES$
  54.  *      // This example function will copy a file to the floppy drive.
  55.  *      // Before doing so it checks that the name of the drive is ok.
  56.  *
  57.  *      function CopyToFloppy(cFileName)
  58.  *      local cFloppy := "A:"
  59.  *      if GT_FlopCnt() == 1
  60.  *         cFloppy := GT_FlopNam()+":"
  61.  *      endif
  62.  *      copy (cFileName) to (cFloppy+cFileName)
  63.  *      return(NIL)
  64.  *  $SEEALSO$
  65.  *      GT_FLOPNAM()
  66.  *  $END$
  67.  */
  68.  
  69. CLIPPER GT_FlopCnt()
  70. {
  71.         _retni((((int) (_GT_peek(0x40,0x10) & 0xC0)) >> 6)+1);
  72. }
  73.