Page 1 of 1

How to crash RunTime Errorsystem Xbase++ 2.0

Posted: Wed Jan 05, 2022 2:52 pm
by slobodan1949
How to crash RunTime Error system Alaska Xbase++ 2.0.1503
***************************************************************************
FUNCTION printer_test()
***************************************************************************
LOCAL oDC := XbpPrinter():New()
LOCAL bErrorHandler, aPrinters

// BUG test 05-01-2022 very unfavorable bug
msgbox("1 - see the non-existent COBA variable")
// the COBA variable does not exist in the program !
* msgbox(COBA) // RunTime reports an error and the program terminates, it's OK !
* Error BASE/2000
* Description: Unicnown variable
* Operation: COBA
*
// BUG:
// if this codeblock is mistakenly duplicated:
bErrorHandler :=ErrorBlock( {|e| Break(e)} )
bErrorHandler :=ErrorBlock( {|e| Break(e)} )

// THEN THE RUNTIME ERROR SYSTEM IS TURNED OFF IN THE EXE APPLICATION
// and more errors are made in msgbox(COBA) does not report.
// The EXE program is silently interrupted in this line,
// so it is very difficult to find an error

BEGIN SEQUENCE
aPrinters := oDC:list()
msgbox(var2char(aPrinters),"Printers:")
RECOVER
msgbox("There are no printers installed in the system","STOP")
RETURN .F.
END SEQUENCE
ErrorBlock( bErrorHandler ) // reset old codeblock

// BUG test 05-01-2022 very unfavorable bug
msgbox("2 - see the non-existent COBA variable")
// BUG:
msgbox(COBA) // RunTime DOES NOT REPORT an error and the program is terminated
* NOT:
* Error BASE/2000
* Description: Unicnown variable
* Operation: COBA
msgbox("3") // that's not OK !

RETURN .T.

Re: How to crash RunTime Errorsystem Xbase++ 2.0

Posted: Wed Jan 05, 2022 4:21 pm
by rdonnay
When the doctor tells you not to do that, you learn to not do that.

Many times I have crashed the error system because it's just not fail-safe.