home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / ferror.prg < prev    next >
Text File  |  1993-10-14  |  2KB  |  113 lines

  1. /*
  2.  * File......: FERROR.PRG
  3.  * Author....: Martin Colloby
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Martin Colloby
  7.  * Date......: 18/4/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Martin Colloby and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      GT_SHOWFERROR()
  24.  *  $CATEGORY$
  25.  *      File I/O
  26.  *  $ONELINER$
  27.  *      Show which file error occured
  28.  *  $SYNTAX$
  29.  *      GT_ShowFError()
  30.  *  $ARGUMENTS$
  31.  *      None
  32.  *  $RETURNS$
  33.  *      NIL
  34.  *  $DESCRIPTION$
  35.  *      Checks the value of FERROR() and outputs an error message in a box
  36.  *  $EXAMPLES$
  37.  *
  38.  *  $SEEALSO$
  39.  *
  40.  *  $INCLUDE$
  41.  *      GT_LIB.CH
  42.  *  $END$
  43.  */
  44.  
  45. *
  46. #include "GT_lib.ch"
  47.  
  48. FUNCTION GT_ShowFError()
  49.  
  50. /*****************************************************************************
  51.  Purpose - Show the current FERROR code
  52.  Returns - None
  53.  Author  - Martin Colloby
  54.  Created - 23/07/92
  55. ******************************************************************************
  56.  Parameters - None
  57.  Privates   - None
  58.  Locals     - None
  59.  Externals  - None
  60. *****************************************************************************/
  61.  
  62. LOCAL cText := ""
  63.  
  64. DO CASE
  65.     CASE FERROR() == 2
  66.         cText := "File not found"
  67.  
  68.     CASE FERROR() == 3
  69.         cText := "Path not found"
  70.  
  71.     CASE FERROR() == 4
  72.         cText := "Too many files open"
  73.  
  74.     CASE FERROR() == 5
  75.         cText := "Access denied"
  76.  
  77.     CASE FERROR() == 6
  78.         cText := "Invalid handle"
  79.  
  80.     CASE FERROR() == 8
  81.         cText := "Insufficient memory"
  82.  
  83.     CASE FERROR() == 15
  84.         cText := "Invalid drive specified"
  85.  
  86.     CASE FERROR() == 19
  87.         cText := "Attempt to write to write protected disk"
  88.  
  89.     CASE FERROR() == 21
  90.         cText := "Drive not ready"
  91.  
  92.     CASE FERROR() == 23
  93.         cText := "Data CRC error"
  94.  
  95.     CASE FERROR() == 29
  96.         cText := "Write fault"
  97.  
  98.     CASE FERROR() == 30
  99.         cText := "Read fault"
  100.  
  101.     CASE FERROR() == 32
  102.         cText := "Sharing violation"
  103.  
  104.     CASE FERROR() == 33
  105.         cText := "Lock violation"
  106.  
  107. ENDCASE
  108.  
  109. GT_Warning( { cText } )
  110.  
  111. RETURN NIL
  112. *
  113.