OK...
I use the On Error Goto OnError method because it is cleaner than try/catch.
It is 3 lines of code compared to 5.
Because I only want the function to return a value/True or nothing/nil and I test for success in the calling function.
Whatever the error is... I want my program to continue and I can deal with the error later.
Being I have programmed basic since 1974 and used Goto statements a long time, I like it.
If you see it and think a try catch is cleaner, you are more than welcome to switch it and repost or convert to other languages.
I switched from try/catch to this more simple syntax as I was refining some of my code a while back.
There are no good writes, just rewrites.
P=
I will try to include the try catch syntax to make it easier to translate.
Let me show you what I see.
Code:
Public Function TestFunction(ByVal rbfLISPArguments As ResultBuffer)
' 5 lines of code to handle errors
Try
' the code
Return tpvTrue
Catch ex As System.Exception
End Try
Return tpvNil
End Function
Code:
' 3 lines of code to handle errors
Public Function TestFunction(ByVal rbfLISPArguments As ResultBuffer)
On Error GoTo OnError
' the code
Return tpvTrue
OnError: Return tpvNil
End Function
What I would like to see is
On Error Return Nothing ... or something like that