home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / FUNCTION / FWERROR.PRG < prev    next >
Text File  |  1994-03-17  |  1KB  |  48 lines

  1. #include "error.ch"
  2. #include "fwerror.ch"
  3.  
  4. // solo para forzar la creación de los simbolos de estas funciones.
  5. external ProcName
  6.  
  7. #define _SUBSYS_     "FiveWin"
  8.  
  9. #define ERR_MESSAGE    1
  10. #define ERR_SEVERITY   2
  11. #define ERR_SUBSYS     3
  12. #define ERR_ERR_NO     4
  13.  
  14. /********  error Handler de OBJECTSP.
  15. */
  16.  
  17. FUNCTION __LowMemError()
  18. return eval( errorBlock(), _FWGenError( MEMORYLOW_ERROR ) )
  19.  
  20. FUNCTION _FWGenError( nError, cOperation )
  21.  
  22.  local aErr := { { "Non defined Id" , ES_CATASTROPHIC,, } , ;
  23.                  { "Duplicated Id"  , ES_CATASTROPHIC,, } , ;
  24.                  { "Cannot create Dialog Box" , ES_CATASTROPHIC,, } , ;
  25.                  { "Memory Low" , ES_WARNING, "BASE", 1001 } ;
  26.                }
  27.  
  28.  local e
  29.  
  30.  if nError > 0 .and. nError <= MAX_DEFINED_ERRORS
  31.  
  32.     e = errornew()
  33.     
  34.     e:severity    = aErr[ nError ][ ERR_SEVERITY ]
  35.     e:candefault  = e:severity < ES_CATASTROPHIC
  36.     e:subsystem   = if( aErr[ nError ][ ERR_SUBSYS ] == nil,;
  37.                         _SUBSYS_ ,;
  38.                         aErr[ nError ][ ERR_SUBSYS ] )
  39.     e:subcode     = if( aErr[ nError ][ ERR_ERR_NO ] == nil,;
  40.                         nError,;
  41.                         aErr[ nError ][ ERR_ERR_NO ] )
  42.     e:description = aErr[ nError ][ ERR_MESSAGE ]
  43.     e:operation   = cOperation
  44.  
  45.  endif
  46.  
  47. Return e
  48.