Error-Handling Functions

Use the following statements and functions to define the way LibreOffice Basic reacts to run-time errors.

LibreOffice Basic offers several methods to prevent the termination of a program when a run-time error occurs.

CVErr Function

แƒ’แƒแƒ แƒ“แƒแƒฅแƒ›แƒœแƒ˜แƒก แƒกแƒขแƒ แƒ˜แƒœแƒ’แƒฃแƒš แƒแƒœ แƒ แƒ˜แƒชแƒฎแƒ•แƒ˜แƒ— แƒ’แƒแƒ›แƒแƒกแƒแƒฎแƒฃแƒšแƒ”แƒ‘แƒแƒก "Error"-แƒ˜แƒก แƒฅแƒ•แƒ” แƒขแƒ˜แƒžแƒ˜แƒก แƒ•แƒแƒ แƒ˜แƒแƒœแƒขแƒฃแƒš แƒ’แƒแƒ›แƒแƒกแƒแƒฎแƒฃแƒšแƒ”แƒ‘แƒแƒ“.

Erl Function

Returns the line number where an error occurred during program execution.

Err Function

Returns an error code that identifies the error that occurred during program execution.

Err Object [VBA]

Use VBA Err object to raise or handle runtime errors.

IsError Function

แƒแƒ›แƒแƒฌแƒ›แƒ”แƒ‘แƒก แƒชแƒ•แƒšแƒแƒ“แƒก แƒจแƒ”แƒชแƒ“แƒแƒ›แƒ˜แƒก แƒจแƒ”แƒ›แƒชแƒ•แƒ”แƒšแƒแƒ‘แƒแƒ–แƒ”.

Error Function

Returns the error message that corresponds to a value or raises a given error context.

On Error GoTo ... Resume Statement

Enables an error-handling routine after an error occurs, or resumes program execution.

Resume Statement

Resets error information and indicates what to execute next.

ScriptForge.Exception service

The Exception service is a collection of methods to assist in code debugging in Basic and Python scripts and in error handling in Basic scripts.

In Basic scripts, when a run-time error occurs, the methods and properties of the Exception service help identify the error context and allow to handle it.

Please support us!