- Code: Select all Expand view
// FWPPC Error System (C) FiveTech Software 2005
#include "error.ch"
//----------------------------------------------------------------------------//
procedure ErrorSys
ErrorBlock( { | o | ShowError( o ) } )
return
//----------------------------------------------------------------------------//
static function ShowError( oError )
local cError := oError:Description
local n := 1
if oError:GenCode == EG_ZERODIV
return 0
end
if ! Empty( oError:Operation )
cError += HB_OSNewLine() + oError:Operation
endif
if ValType( oError:Args ) == "A"
cError += HB_OSNewLine() + " Args:" + HB_OSNewLine()
for n = 1 to Len( oError:Args )
cError += " [" + Str( n, 4 ) + "] = " + ValType( oError:Args[ n ] ) + ;
" " + cValToChar( oError:Args[ n ] ) + HB_OSNewLine()
next
endif
cError += HB_OSNewLine() + "stack calls:" + HB_OSNewLine()
n:=2 // PGF: 22/12/2006
while ! Empty( ProcName( n ) )
cError += AllTrim( ProcName( n ) ) + ;
"(" + AllTrim( Str( ProcLine( n ) ) ) + ")" + HB_OSNewLine()
n++
end
MemoWrit( CurDir() + "\error.txt", cError )
MsgInfo( cError, "FWPPC Error" )
PostQuitMessage( 0 )
QUIT
return .t.
//----------------------------------------------------------------------------//
Saludos