_______________
Code: Select all
' Gambas module file
Public Sub Main()
Print "Hello world"
Print 1 / 0
Catch
' Debug Error.Text 'OK
Debug FormatError( Error ) 'NOT OK: not using ByRef; 'wanted Error got Boolean'
'Debug FormatError(ByRef Error ) 'NOT OK: using ByRef; 'this expression cannot be passed by reference'
End
Public Function FormatError(oError As Error) As String
Dim sResult As String = Null
sResult &= oError.Text & gb.CrLf & Error.Class & gb.CrLf & Error.Where & gb.CrLf & Error.Backtrace
Return sResult
End