How to crash RunTime Errorsystem Xbase++ 2.0

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
slobodan1949
Posts: 80
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

How to crash RunTime Errorsystem Xbase++ 2.0

#1 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to crash RunTime Errorsystem Xbase++ 2.0

#2 Post 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.
The eXpress train is coming - and it has more cars.

Post Reply