|
|
|
|
|
|
|
|
|
|
|
|
|
|
PROGRAMMING POWER
LSI_Info: obscure but useful information in LotusScript
By Mick Moignard
One of the key pieces of most LotusScript error handling routines is delivering a message that explains what the error is, and also exactly where it happened. The project I have been working on for the last two or more years has developed an error handling process that uses the NotesLog OpenNotesLog approach to log all errors to an agent log database. This has worked very well for us, except the odd occasion where a too hasty cut/paste has meant that the error message doesn't actually point to where the error occurred.
The code logs errors to an open NotesLog using, in most cases, a line of code that looks like this:
Call NotesLog.LogError(Err,"DoSomeWorkHere " & Error$ & " - Line: " & Cstr(Erl) & doc.universalID
|
"DoSomeWorkHere " is the name of the sub or function containing the code. We also include the UniversalID of any document being processed so that it is easier to track down exactly what the problem is. Every module has this code in it, carried forward from module to module by simple cut/paste operations, and this is where the problem has crept in. You get an error reported from a line of code such as:
The error reported is Object Variable Not Set error, and in the module in question, i is an integer. After several minutes of puzzlement, questioning the parentage of various code-writers including yourself, and then a search in the code for some other sub with the same literal in the logging statement, the light dawns.
The good news is that there is a solution to this. It's the reserved variable called lsi_info. lsi_info is mentioned in the LotusScript sections of the Designer Help, as a reserved word, but nowhere does it tell you what it contains. But it contains some useful stuff, as I found out.
About lsi_info The variable lsi_info is an array of strings. I have no idea exactly how big it is, but there are non-zero values in some entries above 200. Here are some immediately useful values:
- lsi_info(2) is the current module - sub or function name.
- lsi_info(12) is the module that called this sub or function. If lsi_info(2) is INITIALIZE, then so is lsi_info(12)
From this, we can see that by changing my error reporting line I can make one that is impervious to cut/paste errors:
Call NotesLog.LogError(Err,lsi_info(2) & " called by " & lsi_info(12) & ": " & Error$ & " - Line: " & Cstr(erl) & doc.universalID
|
There's more. I got curious as to what else there may be in lsi_info, and started some digging. Here's what I've found:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.
Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.
Learn how to easily clean up your address book. |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|