[Gambas-user] Error.Raise an error with a code other than -1

Bruce Steers bsteers4 at gmail.com
Thu Jun 9 12:47:34 CEST 2022

Something like this would be handy Ben...

There I simply added a new method to Error class.
Error.RaiseCode(sMsg As String, iCode As Integer)

Works the same as Error.Raise(sMsg As String) but also sets a code other
than -1.

I was just playing with a bit of c

But in all seriousness the Error.Raise() method would be extra useful if
you can have an optional code parameter to set a value other than just the
-1 Error.Raise() gives at present.
using a code could make for better handling in the Catch.

Unless it's already possible to set an error code?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220609/e0a8d6d1/attachment.htm>

More information about the User mailing list