We are migrating the Lotus notes applications from 6.5 to 8.5. While we migrate the application to 8.5 we are getting the error “Error loading USE or Uselsx module” in one of the agent where we used Uselsx. We have tried compiling the Lotus Script and it didnt work. Any solution / Idea?
Subject: Did the compiler complain when it didn’t work?
Same error, most likely, but it never hurts to know explicitly.
Look for “circular use” instances. This is where module A does a use on module B, and module B does a use on module A. Only it goes deeper.
If module A uses module B which uses module C which uses module D, which uses module A, that’s still a circular use. The old LS compiler was pretty poor at catching this, and so your code (depending on complexity) could have a “nested circular use” that the new compiler catches.
I understand that if I have an agent that uses a script library called “ErrorHandling” and in this agent there is a call to a function from another script Library called “specialActions”, if “specialActions” has “use ErrorHandling” there is a circular problem, but then how do I get my Agent and function (in specialActions Script Library) to both use my ErrorHandling ScriptLibrary?
It’s okay to “use” script libraries that are also being "use"d by other libraries you “use”.
Library - Constants
Library - ErrorHandling
Use “Constants”
Agent
Use “ErrorHandling”
Use “Constants”
Although unnecessary, this situation is just fine. You could remove the Constants reference, and still access whatever is defined in Constants because it is implicitly "use"d via ErrorHandling.
What doesn’t work is when libraries use each other.
Library - EmailProcesses
Use “ErrorHanding”
Library - ErrorHandling
Use “EmailProcesses”
EmailProcesses refers to ErrorHandling, and ErrorHandling refers to EmailProcesses. THAT is a circular reference. This situation doesn’t work. If you want your error handling to send emails, then it has to have its own email routines. Or, you could give EmailProcesses its own error handling routines. But two libraries can’t “use” each other.
The other problem that people run into is when different libraries have public functions with the same names.
Library - ErrorHandling
Sub GetDB
Library - EmailProcesses
Sub GetDB
Agent
Use “ErrorHandling”
Use “EmailProcesses”
Initialize
Call GetDB
This situation doesn’t work. This can be fixed with a naming scheme. For example, I will prefix the public processes of a library with an abbreviation of the library name. So I would have created…
Library - ErrorHandling
Sub eh_GetDB
Library - EmailProcesses
Sub ep_GetDB
Another solution to make a process private. If a process is created for the sole use of other processes within the library, then use the Private keyword to limit visibility to within the library only.
Library - Errorhandling
Private Sub GetDB
Sub GetDB isn’t visible to any agent or other design element that might “use” it.