Multiple Script Libraries

Is there a way to reference two script libraries in another script library. I have a script library that works when referencing one other library. I added functionality and need to reference a second script library. Once the second reference is added, object references to originally references library error. (Red squiggly line)and an error of “Illegal executable code at module level”

Example of my code…

Use “SwPDFMain”

Use “Company”

Dim swPDF As New SwPDFCreator <—Errors

If I rem out the “Use Company”, the error on dim swPDF goes away.

I need both libraries. One is from a vendor and is hidden so I can’t combine the two.

Any suggestions…

Thanks!

Subject: Yes, you can.

I do it all the time, I have some script libraries who are nested 3-4 levels deep, and multiple libraries in each.

In your example, what script libraries does the “Company” script library use? I suspect that is where your problem lays, some kind of circular reference.

Subject: Example

Here is an example from some of my production code:

Agent code:

Option Public

Option Declare

Use “Class.ClaimData”

Use “Class.NABfunctions”

The script library “Class.ClaimData” contains:

Option Public

Option Declare

Use “Functions.Globals”

Use “Class.ClaimLink”

Use “Functions.User”

Use “Functions.XML”

Use “Class.DocumentLocking”

The script library “Class.NABfunctions” does not use any script libraries.

The script library “Class.ClaimLink” contains:

Option Public

Option Declare

Use “Functions.Globals”

Use “Class.DateTime”

Use “Class.NABfunctions”

Use “Functions.XML”

Use “Class.RemoteHTML”

The script library “Functions.Globals” contains:

Option Public

Option Declare

Use “Declarations.Globals”

Use “Class.GlobalSettings”

Use “Class.PersonalSettings”

Use “Functions.Win32.SystemInfo”

Etc…

As you can see, there is no problem to use multiple script libraries in an agent or another script library.

Subject: Thanks Karl

The problem is i can’t see the contents of one script library. It was provided by an outside vendor and is hidden. - I’ll have to look at our script library to see if I can do something… Thanks !