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)


1) I would like IBM to give up on the 64K limits anyway
Henning Heinz | 5/12/2010 10:08:31 AM

It would be great if IBM in general would think about the 16,32 and 64K limits of Domino. Backwards compatibility is a great thing but with Domino now going 64Bit sometime in the future its core limitations staying at 64K and less is hardly understandable for anyone new to Domino development.

And Ctrl-Alt-L was new to me. Thank you for sharing.

2) Is thera 64K limi for Classes?
Peter Presnell | 5/12/2010 4:38:00 PM

Hi Andre,

I am not sure if it is because I am using 8.5.2 beta, but I am not seeing any evidence of there being a 64K limit on the size of any one LotusScript section. I have a LotusScript library with over 11,000 lines of code, 99% of which are in classes. It seems to split my code up into multiple $ScriptLib fields breaking them up when they reach 61,310 characters and not breaking them up based on sections.

I think the Erl value is only out by the number of lines in the Options Section. So I have taught myself to factor that number in to locate the error line.

3) Finding Erl lines
Mick Moignard | 5/13/2010 3:37:35 AM

More than once, to solve this one, I've turned off the new LS editor in Designer Preferences, and reopened the code in the old editor to find the correct line.

Knowledgebase entry 1430623 also discusses this issue and explains another workround.

4) smarter
kMagic | 5/13/2010 12:36:56 PM

Just click on the head in the library navigation, where you find all the code lines. Count the lines they are above the declarations (if you click on declarations you see where they start). Add the number of lines to Erl line and search for this Ctrl+Alt+L.

For me it works (fast workaround).

5) Did you know about the "Go to Erl Line" menu?
Andre Guirard | 5/13/2010 3:27:55 PM

@All, the Erl value is the offset from the beginning of the Declarations section. So yes, you can first see how many lines are in the Options section (let's say you've done a good header comment and there are 23), then go to the "all code" screen and "go to line" 23+Erl. To me, the menu command that just lets you enter Erl and does that math for you is less trouble. I've noticed there's a certain amount of flakiness when editing in the "all code" screen, e.g. when you delete the first or last line of a section, so I don't like to work there.

6) 64?
Erik Brooks | 5/26/2010 11:08:46 PM

IIRC the 64k library limit was raised to 128k in ND6.

But yes, the 16/32/64K limits in NSF/LS get maddening at times. The saddest is @DbColumn() in SSJS -- here's this shiny new XPage technology, and... 64K limit? Huh? There should at least be an @DbColumnBig() or something.

We can hope for R9. I'd love to see NSF get some more love.

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact