Search DominoPower's 11,443 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
Syncing Notes with Android phones
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
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login