home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / VOL10N22.ZIP / CDISK.PRG < prev    next >
Text File  |  1991-07-19  |  1KB  |  27 lines

  1. ***********************************************************************
  2. * CDISK.PRG                    Contains CURDISK() UDF for Clipper S87
  3. * Demonstrates use of CURDISK() Clipper UDF.
  4. ***********************************************************************
  5. ?
  6. ? "Current Disk Drive -> " + CURDISK()
  7. ?
  8. RETURN
  9.  
  10. ***********************************************************************
  11. * CURDISK() - Get current disk drive letter.     UDF for Clipper S87
  12. ***********************************************************************
  13. FUNCTION CURDISK
  14. PRIVATE xRetVal, xHandle1, xRow, xCol
  15.  
  16.    xRow = ROW()                               && save cursor position, row
  17.    xCol = COL()                               && and column
  18.    RUN CD > TMP.                              && run "CD" redirected to a file
  19.    xHandle1 = FOPEN("TMP.",0)                 && open file
  20.    xRetVal  = FREADSTR(xHandle1, 2)           && read first 2 chars
  21.    xRetVal  = IIF(":" $ xRetVal, xRetVal, "") && check for error
  22.    FCLOSE(xHandle1)                           && close file
  23.    ERASE TMP.                                 && erase file
  24.    @ xRow, xCol SAY ""                        && restore cursor position
  25.  
  26. RETURN xRetVal
  27.