_Break Function |
Namespace: XSharp.RT
1FUNCTION Start() 2 // Declare "Export Local" for code block 3 // efficiency 4 LOCAL cbSaveHandler 5 LOCAL oError 6 // Set up your own error block.<br /> 7If an error 8 // occurs, your error block will invoke a BREAK 9 // that will take you to the RECOVER line. 10 cbSaveHandler := ErrorBlock({|x| _Break(x)}) 11 BEGIN SEQUENCE 12 USE myfile 13 // If error here, the installed code block 14 // is executed and the _Break() in it gets 15 // you to the line after RECOVER statement 16 RECOVER USING oError 17 // You will get via the _Break() only if an 18 // error occurs that invokes the installed error handler 19 ? "Error opening file" 20 InKey(0) 21 QUIT // NOTE 22 END 23 // Restore the default error handler 24 ErrorBlock(cbSaveHandler)