Undocumented but interesting errorhandling

GetThreadInfo may not always give what you want. For debuging purposes Lsi_Info is a little better. BUT Warning from severals sites as well as openlog is that Lsi_Info is not thread safe, and should not be used in production!

Typical Example errorhandler

ErrorHandler:
    Messagebox “The ” & Lsi_info(2) & ” event at line #” & Erl & ” generated error ” & Cstr(Err()) & “: ” &   Error$ & Chr(10) & “This routine was called from parent function ” & Lsi_info(12) & “.”
    msg = msg + “Current line number (1): ” & Lsi_info(1) & Chr(10)
    msg = msg + “Current function or sub (2): ” & Lsi_info(2) & Chr(10)
    msg = msg + “Current module (3): ” & Lsi_info(3) & Chr(10)
    msg = msg + “LotusScript version (6): ” & Lsi_info(6) & Chr(10)
    msg = msg + “Language (9): ” & Lsi_info(9) & Chr(10)
    msg = msg + “Calling code name (12): ” & Lsi_info(12) & Chr(10)
    msg = msg + “Memory allocated (50): ” & Lsi_info(50) & Chr(10)
    msg = msg + “Memory allocated from OS (51): ” & Lsi_info(51) & Chr(10)
    msg = msg + “Memory blocks used (52): ” & Lsi_info(52) & Chr(10)
    Msgbox msg
    Exit Sub

Kommentera

E-postadressen publiceras inte. Obligatoriska fält är märkta *

tretton − åtta =