This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Sep 11, 2015, 4:36 PM
14 Posts

LotusScript: 1 central file for common functions

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 2

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.

Sep 14, 2015, 10:29 AM
1 Posts
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.

Sep 19, 2015, 12:37 AM
43 Posts
If you just want to avoid updating in multiple places, you can use design element inherita...

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


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal