Module: errorsys      Library: Clipper 5.3


This module contains the following functions and procedures:



Note: Because this is raw decompiler output, the code is closer
to that seen in a .PPO file, rather than a .PRG file. In other
words, you must allow for the preprocessor conversions normally 
performed based on the contents of STD.CH and other .CH files
 
#include "common.ch"
#include "inkey.ch"

//---------------------------------------------------[top]-
//  DEFERROR( Arg1 )
//
static function DEFERROR( Arg1 )

   local Local1, Local2, Local3, Local4
   if ( Arg1:gencode() == 5 )
      return 0
   endif
   if ( Arg1:gencode() == 21 .AND. Arg1:oscode() == 32 .AND. ;
         Arg1:candefault() )
      neterr(.T.)
      return .F.
   endif
   if ( Arg1:gencode() == 40 .AND. Arg1:candefault() )
      neterr(.T.)
      return .F.
   endif
   Local2 := errormessa(Arg1)
   Local3 := {"Quit"}
   if ( Arg1:canretry() )
      AAdd(Local3, "Retry")
   endif
   if ( Arg1:candefault() )
      AAdd(Local3, "Default")
   endif
   Local4 := 0
   do while ( Local4 == 0 )
      if ( Empty(Arg1:oscode()) )
         Local4 := alert(Local2, Local3)
      else
         Local4 := alert(Local2 + ";(DOS Error " + ;
            LTrim(Str(Arg1:oscode())) + ")", Local3)
      endif
      if ( ISNIL( Local4 ) )
         exit
      endif
   enddo
   if ( !Empty(Local4) )
      if ( Local3[ Local4 ] == "Break" )
         break( Arg1 )
      elseif ( Local3[ Local4 ] == "Retry" )
         return .T.
      elseif ( Local3[ Local4 ] == "Default" )
         return .F.
      endif
   endif
   if ( !Empty(Arg1:oscode()) )
      Local2 := Local2 + ( " (DOS Error " + LTrim(Str(Arg1:oscode())) ;
         + ") " )
   endif
   outerr(Chr(13) + Chr(10))
   outerr(Local2)
   Local1 := 2
   do while ( !Empty(procname(Local1)) )
      outerr(Chr(13) + Chr(10))
      outerr("Called from", Trim(procname(Local1)) + "(" + ;
         LTrim(Str(procline(Local1))) + ")  ")
      Local1++
   enddo
   errorlevel(1)
   quit
   return .F.

//---------------------------------------------------[top]-
//  ERRORMESSA( Arg1 )
//
static function ERRORMESSA( Arg1 )

   local Local1
   Local1 := iif( Arg1:severity() > 1, "Error ", "Warning " )
   if ( ISCHARACTER( Arg1:subsystem() ) )
      Local1 := Local1 + Arg1:subsystem()
   else
      Local1 := Local1 + "???"
   endif
   if ( ISNUMBER( Arg1:subcode() ) )
      Local1 := Local1 + ( "/" + LTrim(Str(Arg1:subcode())) )
   else
      Local1 := Local1 + "/???"
   endif
   if ( ISCHARACTER( Arg1:descriptio() ) )
      Local1 := Local1 + ( "  " + Arg1:descriptio() )
   endif
   if ( !Empty(Arg1:filename()) )
      Local1 := Local1 + ( ": " + Arg1:filename() )
   elseif ( !Empty(Arg1:operation()) )
      Local1 := Local1 + ( ": " + Arg1:operation() )
   endif
   return Local1

//---------------------------------------------------[top]-
//  ERRORSYS
//
procedure ERRORSYS

   errorblock({ |_1| deferror(_1) })
   return

//---EOF


Use your Browser's BACK button to return to Function Listings