Windows Support Chat

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 7 April 2007

LotusScript and the Curious Case of the "Name previously declared" error

Posted on 16:56 by Unknown
During final testing of the NotesTracker Version 5.0 (released on 4/4/2007), I was amazed to get an annoying LotusScript error popping up where it should never have.

It turned out to be what I'd term a "quirk" of the LotusScript compilation process and happened with only one of about six databases that I was testing. The reason that I'm writing about it is to assist others who might encounter the same quirk in future and hopefully give them a few ideas about resolving the matter and so save them some time and heartache.

It occurred when I tried to replace the NotesTracker V4 LotusScript subroutines in the Database Script design element of the database with their V5.0 editions. The new code steadfastly refused to compile and kept giving the "Name previously declared" error message.

Keep in mind that I had already updated the Database Script section of three or four other databases without encountering this, and it was indeed puzzling (and frustrating). I did all of the usual things: checked for duplicate name definitions (Dim statements), but there were none. Naturally I tried the "Recompile All LotusScript" tools option but that didn't fix the problem either.

I turned to Google search ( http://www.google.com.au/search?hl=en&q=%22name+previously+declared%22+lotusscript ) but nobody seemed to have reported exactly the problem I had.

There ensued more tearing out of hair, muttering uncomplimentary things about Lotus, blaming global warming, tossing salt over my left shoulder and incantations to the compiler gods -- all to no avail.

Then, in a burst of inspiration from the primitive "id" part of my brain I hit upon the solution (see image). I deleted the entire Database Script, as shown, and pasted exactly the same code back into the Declarations and subroutines areas of the now-empty Script.

And it worked! There was no compilation error and at last I was able to save the Script.

Go figure it out. I certainly can't.

Apparently something got "screwed up" in the internals of the Database Script's structure that caused perfectly legitimate code to fail.

So if you encounter this LotusScript error and all the usual techniques fail to get your code compiled, try this technique to clear out all of the code in that section (Database Script, or whatever) and paste the code back in.

A few hours lost, but a useful lesson learned: sometimes the LotusScript compiler will reject perfectly satisfactory code. In this case there's a chance that you can overcome the compilation problem by removing all of the subroutines in the object (the Database Script, or a Script Library), performing a Save (or Recompile All LotusScript), and then pasting it back unchanged.

I've coined a motto for such LotusScript quirky behavior:
If you can't beat it, delete it!... And then, repeat it.
Did this help you? Please let me know.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • The programmer/developer/coder role is not dead – and long live the project manager!
    It’s no problem being a geek, it would seem, according to Jason Hiner in his ZDNet blog posting The future of IT jobs? It's in three ...
  • I was going to delay writing this, but here it is anyway …
    What’s the difference between ignorance and apathy?    ANSWER: I don’t know, and I don’t care! It’s been one of those days for me, ...
  • The premise is … I’m getting even madder
    I was reading this IBM Redbook today, and it didn’t make a good first impression: I really love IBM Redbooks, but not at all the way...
  • LotusScript and the Curious Case of the "Name previously declared" error
    During final testing of the NotesTracker Version 5.0 (released on 4/4/2007), I was amazed to get an annoying LotusScript error popping up wh...
  • The "Do no harm" principle
    In all my IT work over the decades, I have always tried to abide by the maxim "Do no harm". A subtitle of this post could be: ...
  • Which one is "bigger" -- Microsoft or IBM?
    There's an IT industry debate that has been going on for a decade or more now, about whether or not " The mainframe is dead." ...
  • Windows 7 SP1 upgrade went horribly wrong … NetBeans IDE 7.0 Beta 2, MailWasher and the Christchurch earthquake
    Installing the Windows 7 Service Pack 1 (SP1) on my workhorse desktop system last Saturday turned into a total disaster for me, a really ...
  • IBM invites you... Tune Your Servers!
    IBM's Redbooks are sometimes of considerable to those who don't use IBM software and hardware, one example of which is TCP/IP Tutori...
  • The benefits of ever-decreasing technology size and weight
    This video obviously applies to the old-style PC hardware of the 1980s and 1990s, so presumably newer technology (such as LCD monitors) i...
  • IBM Symphony Plug-ins site has an Achilles’ Heel
    It seems that a weakness of the IBM Lotus Symphony plug-ins site is that not all of the plug-ins are hosted by IBM, and you can suffer tryin...

Categories

  • Add-ons
  • Adobe Reader
  • AJAX
  • Application Platform
  • Architecture
  • AS/400
  • Asia
  • Australia
  • Bad Software
  • Browser
  • Browser Share
  • Bug
  • Bushfire
  • Business
  • Chemistry
  • China
  • Coding
  • Communication
  • Communities of Interest
  • Crossword
  • Crosswords
  • Curiosity
  • Device Drivers
  • DLL hell
  • Documentation
  • Dragon
  • Durian
  • Ecosystems
  • Error Messages
  • Eudora
  • Extensions
  • Facetiousness
  • Failure
  • Firefox
  • FOSS
  • Freelance
  • Freeware
  • Fun
  • Heat Wave
  • Humor
  • i Series
  • IBM
  • IBM Systems
  • IE
  • Image resource manipulation
  • Innovation
  • Installation
  • Internet Explorer
  • Intranet
  • Japan
  • Koala
  • Linux
  • Live Writer
  • Lotus Domino
  • Lotus Notes
  • Lotus Notes Lotus Domino
  • Lotus Software
  • LotusScript
  • Mainframe
  • Melbourne (Australia)
  • Microsoft
  • Multiple
  • Natural Disaster
  • NaturallySpeaking
  • Nigerian 419 fraud
  • Notes Mail
  • NotesTracker
  • Nuance
  • Open Source
  • OpenNTF.ORG
  • Patents
  • POSS
  • PowerPoint
  • Pragmatism
  • Presenter
  • Print Server
  • Project Management
  • Pronunciation
  • Proprietary
  • Registry
  • Releases
  • Research and Development
  • RIA
  • SDMS
  • Security
  • Service Oriented Architecture
  • SNA
  • SOA
  • Software
  • Software Package
  • speech recognition
  • Spell Checking
  • Standards
  • System i
  • System/38
  • TCP/IP
  • Technology
  • Usability
  • Usability Testing
  • Versions
  • Victoria
  • Weather
  • Web 2.0
  • Web 3.0
  • Web Design
  • Web Pi
  • Web Services
  • Webshots.com
  • Windows
  • Windows 7 backgrounds
  • Words
  • z Series

Blog Archive

  • ►  2013 (25)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  June (7)
    • ►  May (1)
    • ►  April (7)
    • ►  March (2)
    • ►  February (4)
  • ►  2012 (25)
    • ►  December (7)
    • ►  November (1)
    • ►  October (1)
    • ►  September (3)
    • ►  August (1)
    • ►  July (1)
    • ►  June (6)
    • ►  May (2)
    • ►  April (2)
    • ►  March (1)
  • ►  2011 (20)
    • ►  December (3)
    • ►  November (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  March (4)
    • ►  February (2)
    • ►  January (5)
  • ►  2010 (69)
    • ►  November (2)
    • ►  October (3)
    • ►  September (5)
    • ►  August (13)
    • ►  July (3)
    • ►  June (3)
    • ►  May (2)
    • ►  April (10)
    • ►  March (10)
    • ►  February (8)
    • ►  January (10)
  • ►  2009 (41)
    • ►  December (5)
    • ►  November (6)
    • ►  October (5)
    • ►  September (4)
    • ►  August (1)
    • ►  June (1)
    • ►  May (3)
    • ►  April (2)
    • ►  February (9)
    • ►  January (5)
  • ►  2008 (16)
    • ►  November (3)
    • ►  October (3)
    • ►  August (2)
    • ►  July (3)
    • ►  June (1)
    • ►  April (1)
    • ►  February (1)
    • ►  January (2)
  • ▼  2007 (39)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (5)
    • ►  June (1)
    • ►  May (2)
    • ▼  April (11)
      • SDMS version 4.2 is now available
      • IBM Mainframe Strengths and Values - for Gaming?
      • Web 3.0 is Underway -- but "Web Pi" is unreachable
      • How to fix Eudora spell checker not remembering ad...
      • NotesTracker Version 5.0 -- released on 4/4/2007
      • The Dire Consequences of Fixed-Price IT Projects
      • Dr. Pongsol SOLves the PONG (of durians)
      • Linux, Linux on the wall. Who's the prettiest of t...
      • Another weird LotusScript compiler problem
      • The Four Yorkshiremen, punched cards, and other ta...
      • LotusScript and the Curious Case of the "Name prev...
    • ►  March (5)
    • ►  February (8)
    • ►  January (4)
  • ►  2006 (98)
    • ►  December (8)
    • ►  November (25)
    • ►  October (6)
    • ►  September (6)
    • ►  August (5)
    • ►  July (6)
    • ►  June (16)
    • ►  May (17)
    • ►  April (2)
    • ►  March (4)
    • ►  February (3)
  • ►  2005 (38)
    • ►  November (5)
    • ►  September (2)
    • ►  August (10)
    • ►  July (14)
    • ►  June (3)
    • ►  April (3)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile