home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / getdname.c < prev    next >
C/C++ Source or Header  |  1993-05-19  |  1KB  |  36 lines

  1. /*****************************************************************************
  2. * Function: _GT_Internal_GetDriveName()                                      *
  3. * Syntax..: char _GT_Internal_GetDriveName(int Parameter)                    *
  4. * Usage...: Internal function to get a drive name.                           *
  5. * By......: David A Pearson                                                  *
  6. *****************************************************************************/
  7.  
  8. #include <extend.h>
  9.  
  10. char _GT_Internal_GetDriveName(int Parameter)
  11. {
  12.         char Drive = 0;
  13.  
  14.         if (ISCHAR(Parameter))
  15.         {
  16.                 Drive = _parc(Parameter)[0];
  17.                 if (Drive >= 'a' && Drive <= 'z')
  18.                 {
  19.                         Drive -= 0x60;
  20.                 }
  21.                 else if (Drive >= 'A' && Drive <= 'Z')
  22.                 {
  23.                         Drive -= 0x40;
  24.                 }
  25.                 else
  26.                 {
  27.                         Drive = 0;
  28.                 }
  29.         }
  30.         else if (ISNUM(Parameter))
  31.         {
  32.                 Drive = (char)_parni(Parameter);
  33.         }
  34.         return(Drive);
  35. }
  36.