Hi everybody,
I have been struggling for hours with the problem of not knowing how to throw an error without using VBASupport mode. I am using LO 24.2.1.2 on a Mac (Apple Silicon) and here is the code that I want to change (cf. my comments)
Option VBASupport 1 ' I don't like to use VBA support
Sub RaiseErrorInVBA
On Local Error GoTo Alert
Number = 1102 ' I'd like to define my own errno
Source = "My Error Source" ' I'd like to define the source
Description = "My error description" ' I'd like to give a description
Err.Raise(Number, Source, Description) ' I'd like to use _pure_ LO Basic
MsgBox ("Never reach this line") ' instead of using VBA »Err.Raise«
Exit Sub
Alert: ' I'd like to use Err, Erl, Error$
MsgBox "Error "& Err &" at line "& Erl &" in "& Err.Source _
&" as "& Err.Description, MB_ICONEXCLAMATION
End Sub
Can somebody please help me and show me how to do it in »pure LO Basic«?
Thank you very much
Thomas