Subject: RE: Form Scope help
It could be that one script library “uses” another and this duplicate variable is actually declared in one of the script libraries in the chain.
As for your other questions, I suspect you have read the designer help topic titled “Scope of Declarations” but sometimes it’s better to understand how those declarations work rather than interpreting the definitions.
The form has another Declarations section, which is hanging off the “formname (Form)” tree.
Variables declared in the Globals declaration section of the form are visible to ANY LotusScript code within the form, be that form events, fields, hotspots, actions, etc. Those declared in the Declarations section “hanging off the Form tree” are visible only to Form events, not fields, or hotspots, etc.
What scope is the script library’s Options and Declarations? If it’s declared in the Globals’ declarations, and initialized in the Globals’ Initialize statement, would it be available to everything on the form?
The Script Library declarations section will declare variables visible to all other code that “uses” that script library, unless the variable is marked as Private. Public variables (or those with undeclared scope) can be set in the Script Library’s Initialize and have that value visible to all other script using the script library.
The library’s Use statement is in the form’s Globals section, so shouldn’t any declarations made in the library’s Declarations be equivalent to the form’s Globals section?
Yes. But while a script library can be used within other script elements, a form’s Globally declared variables cannot. So, sometimes you declare global variables in script because those will be used by code that runs in forms, subforms, agents, etc.
And now I have to run - it is the end of my day. Hope that helps.