Option Declare

Hi,

I have a problem with ‘Option Declare’ not working properly.

I use a lot of Script Libraries in our application. All the Script Libraries have the Options set to Option Declare.

I changed the database reference from

Dim db as NotesDatabase

to

Dim ndb as NotesDatabase

The code compiled without any problems, but gave me run time error.

Any ideas how this can be solved…

Subject: Option Declare

In the current implementation of LotusScript ‘Option Declare’ is a joke. It only works sometimes and sometimes is not good enough for reliable programs. It’s right that you have to use the ‘recompile’ option but even than it does not catch all problems.

Subject: RE: Option Declare

Indeed, I tried ‘recompile’ option, that too did not pick up the missing variables.

Is there any fix for this? Any alternatives?

Cheers

Navneet

Subject: RE: Option Declare

I think you’ve misunderstood what this option is supposed to do. I use it all the time and I have found it to be 100% reliable.

“Option Declare” (as well as every other option) applies only to the script that contains that statement. If you have a script library that uses Option Declare, and you “use” this script library in a some agent that doesn’t have “Option Declare”, then you will not receive compiler warnings for undeclared variables in the agent. That’s how it’s designed to work.

If there is some situation where you think Option Declare is not doing what it’s supposed to, please give details and if I agree with you that it’s wrong, then I’ll write a bug report.

Subject: Option Declare

Hi,

try the “Recompile All LotusScript” command, which is in the Tools menu. Maybe this will give you a helpful compile-time error.

Best regards
Mario Varchmin