Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

Do any of you ever think you already know how to do Notes development and forget to read the help and look through the menus for useful new commands? (Raises hand sheepishly.)

I'm referring to the Navigate / Go to Erl Line menu item (Ctrl-Alt-L) in version 8.5.x.

I'd been having a problem finding what line an error occurred on in some LotusScript code. The code was in a class, and the new LotusScript editor divides each class into its own section. But behind the scenes they are all merged into the (Declarations) section when you save, just like in the old editor. So when you trap an error and look at the value of Erl, you actually get the position within the combined Declarations section. But you can't see this section on the screen all at once by itself.

It's not impossible to figure out which line it was, but it is lot harder without this menu item. My solution was to write error traps that would use GetThreadInfo to get the error line number relative to the first line of the error trap (e.g. the eventual error message would show the line number as -19, meaning 19 lines above the Error statement that threw the error). Now, of course, I will take those out and just use Erl!

A still better solution would be to change Erl to return the position of the error within the class. To do this would require some fiddly changes in the way LotusScript is stored; each class would need to be put in its own "section" (when the code is stored, not just when it's presented on screen). This would have a side benefit; you would escape the 64K limit on the total size of the Declarations section and instead have a limit of 64K per class, allowing for much more object-oriented code to be put into a single library. At the moment, you can put as many Functions and Subs as you like, each being 64K or less, but once you get to classes you're limited.

It probably would not be backward compatible. Perhaps it could be done based on a preference or an Option statement.

Andre Guirard | 12 May 2010 09:00:00 AM ET | | Comments (4)

Search this blog 


    About IBM Privacy Contact