Search DominoPower's 11,433 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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:

i = i + 1

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:


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
How not to crash in LotusScript
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login