home *** CD-ROM | disk | FTP | other *** search
- ***********************************************************************
- * CDISK.PRG Contains CURDISK() UDF for Clipper S87
- * Demonstrates use of CURDISK() Clipper UDF.
- ***********************************************************************
- ?
- ? "Current Disk Drive -> " + CURDISK()
- ?
- RETURN
-
- ***********************************************************************
- * CURDISK() - Get current disk drive letter. UDF for Clipper S87
- ***********************************************************************
- FUNCTION CURDISK
- PRIVATE xRetVal, xHandle1, xRow, xCol
-
- xRow = ROW() && save cursor position, row
- xCol = COL() && and column
- RUN CD > TMP. && run "CD" redirected to a file
- xHandle1 = FOPEN("TMP.",0) && open file
- xRetVal = FREADSTR(xHandle1, 2) && read first 2 chars
- xRetVal = IIF(":" $ xRetVal, xRetVal, "") && check for error
- FCLOSE(xHandle1) && close file
- ERASE TMP. && erase file
- @ xRow, xCol SAY "" && restore cursor position
-
- RETURN xRetVal