(sub/function) INITIALIZE) Error 1234: test error here~ in line 5
from sub/function A in line: 5
from sub/function B in line: 6
Option Public
Option Declare
%Include "lsconst.lss"
Private traced_array As Variant
Function getTracedError As Variant
Dim error_msg As String
If IsEmpty(traced_array) Then traced_array = Split("")
error_msg = "(sub/function " & GetThreadInfo(LSI_THREAD_CALLPROC) & ") Error " & Err & ": " & Error & " in line " & Erl
traced_array = FullTrim(ArrayAppend(Split(error_msg, ""), traced_array))
getTracedError = traced_array
End Function
Sub traceError
Dim error_msg As String
If IsEmpty(traced_array) Then traced_array = Split("")
error_msg = Chr(9) & "from sub/function " & GetThreadInfo(LSI_THREAD_CALLPROC) & " in line: " & Erl
traced_array = FullTrim(ArrayAppend(Split(error_msg, ""), traced_array))
Error Err, Error$
End Sub