We’re currently putting a script library called “globals” in each database for commonly used function/subroutines. The problem is it’s not truly “global”. Only agents in the same database can use it; therefore, we have dozens of copies of this thing all over the place. Obviously not ideal if you need to update something. Is there a way to have 1 central location that all databases can “see” to avoid this redundancy? Open to any ideas. Thanks.
Subject: If you just want to avoid updating in multiple places, you can use design element inheritance
For example it is possible to have your script libraries inherit from a different template than your database. That way you can have a single nsf that you can update for that global functions and any changes will propagate to various databases that use those script libraries.
Have you take a look at the design properties of your script libraries ? In particular the section that have Inherit design from template and Prohibit design replace / refresh checkbox ?
Regards
Tinus Riyanto
Subject: There is a way
I see you posted this in more than one forum. I have posted my response in both.
You can have your LotusScript code in .lss-files, and ‘include’ them into your agents/libraries.
This works fine, provided the developers with edit rights to these shared libraries can all access them. Not that hard, you can set up/map to a shared drive that you use for this purpose.
An example
This goes to the ‘Options’ part of your agent/library:
%INCLUDE “x:\common_lotusscript\somecode.lss”
The somecode.lss file has all the subs/functions and ‘Use’ statements you want, for example:
Use “CLASS: registryaccessClass”
Sub mySub()
xxx
End Sub
Public Sub anotherSub()
xxx
End Sub
Private Function myFunction() As Boolean
xxx
Return True
End Function
Etc., etc.
The lss-files need to be available when the agents/libraries are compiled, not when they are executed. So a set of developers can have common code available to them at compile-time and it will execute just fine for users without access to those lss-files.