How Do I Call DIAdem VB Script Routines Within SUD Code?

Updated May 10, 2018

Reported In

Software

  • DIAdem

Operating System

  • Windows

Issue Details

My DIAdem VB script has a particular function defined in it. From the same VB script, I load an SUD dialog. Within the SUD code, I want to be able to call that function. Is this possible?

Solution

The DIAdem Script Panel and the SUD Dialog Editor are using two different scripting hosts. This means the functions and subroutines declared in the script in the DIAdem Script Panel are not shared with the SUD code. For this reason, any functions you declare for use in the SUD Dialog must be located in the "Declarations" section of the SUD Dialog.

If you want to call the same VB Script function from both the parent script and the child SUD Dialog, you can put the functions in a VB script library and link the library into both the parent script and the child SUD Dialog with the ScriptInclude() function.

Additional Information

A VB Script library is just a VB Script file with only subroutines and functions inside of it, such that when you run the VB Script nothing happens. It is good practice to use the SubSequence call at the top of a script library. This guarantees that the script cannot just be run by itself.

If your DIAdem version is earlier than DIAdem 9.1, the ScriptInclude() function will not work in the SUD Dialog, and you will have to build your own with the "Execute" command.

Additionally, your only option to pass variables back from the child SUD Dialog to the parent DIAdem script is with DIAdem global variables.

WAS THIS ARTICLE HELPFUL?

Not Helpful