This project has moved and is read-only. For the latest updates, please go here.

Implementing Vbscript libraries

Jul 8, 2015 at 5:13 AM
By Vbscript libraries i mean a file having a collection of Vbscript Functions and SubRoutines.

Consider the following file setup:

Driver File:
Call Func1
Call Func 2

Library File1:
Function Func1
Some code
End Function

Library File2:
Function Func2
Some code
End Function


Right now i am appending all the code in both library 1 and library2 with Driver file before having them to execute.

Can you please suggest the best way to add vbscript libarary.
As i would also need to implement stacktrace in reports where the location of the code calling will also be reported
Coordinator
Jul 11, 2015 at 12:43 PM
Greetings!

You can execute as many scripts as you'd like within a given engine instance, so how you organize your script code is up to you. Each script can install procedures, functions, classes, etc. You might also be able to design something like RequireJS for VBScript if you're looking for a more robust, on-demand module system.

As for stack traces, ClearScript provides ScriptEngine.GetStackTrace(), but debugging must be enabled for it to work.

Good luck!