Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
LSI_Info: obscure but useful information in LotusScript (continued)

  • lsi_info(1) has been documented in other places as containing the line number, same as erl(). It doesn't. I don't know what it is.
  • lsi_info(6) contains the current version of LotusScript. I can't see hugely where it might be helpful, but I have in the past had LS code that has interrogated the Notes build version to see whether something can be done or not, so there may be cases where knowing the Script version would help.
  • lsi_info(9) contains the current language setting. For example, "en" is English.

I also found some memory-related values:

  • lsi_info(50) contains the amount of memory allocated to LotusScript.
  • lsi_info(51) contains the amount of memory allocated to LotusScript from the OS. How this differs from lsi_info(50), I'm not sure.
  • lsi_info(52) contains the number of memory blocks allocated.

I guess these might be of value occasionally if you seem to have memory-related problems. But as LotusScript does all the memory management for you, there seems to me to be little value in these for mainstream LS programming.

Here are some clock values:

  • lsi_info(98) is the number of clock-ticks per second, apparently is only supported on platforms that support parallel processing.
  • lsi_info(99) is the number of clock ticks. No, I don't now how useful this would be either.

More strange curiosities:

  • lsi_info(420) is the current line number, same as erl()
  • lsi_info(421) is the name of the current module, and seems to be the same as lsi_info(2)
  • lsi_info(430) is the line number in the calling module that called this module.

This last now enables us to extend our error reporting line:

Call NotesLog.LogError(Err,Lsi_info(2) & " called by " & Lsi_info(12) & "(" & Lsi_info(430) & "): " & Error$ & " - Line: " & Cstr(Erl) & doc.universalID

of course we could use a print or messagebox statement. The following Print statement:

Print Lsi_info(2) & " called by " & Lsi_info(12) & "(" & Lsi_info(430) & "): " & Error$ & " - Line: " & Cstr(Erl)

might generate a line such:

SUBSUBMODULE called by SUBMODULE(8): Division by zero - Line: 4

And that's progress. We now have a line of code that, when used in an error-handling block, will generate a meaningful error message, and which can be copied and pasted with no need to change anything.

More info from GetThreadInfo
When I was researching this article, I also came across the LotusScript function GetThreadInfo. The help for this says that it returns system information about the thread. It explains that there are a small number of constants that you can pass to it, and it will return appropriate values.

These constants are defined in the lsprcval.lss file (not lsprval.lss, without the "c", as the help says) that you will find in your Notes client program directory. All of these return values that can be found in the lsi_info value set, as shown in Table A.




[ Prev | Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

2-Minute Tutorials
How do I...

  • integrate MS Office or OpenOffice with Notes?
  • create cross-tab reports and charts?
  • print serial letters and mailing labels?
  • create PDFs in Lotus Notes?


Check out the 2-minute tutorials here.
-- Advertisement --

Six Great Tools for IBM Lotus Sametime
  • Encrypted and secure, browser-based, persistent chat rooms
  • Complete chat logging and auditing
  • Easy-to-define IM help desk queues
  • Manage buddy lists across any organization
  • Integrate awareness into Microsoft Outlook
  • High powered, rapid bot development tools


Visit Instant Tech for free trials and more information.
Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login