DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

scriptstart function

I want to use the function scriptstart to run a VBScript and call a function that is defined within this script. Everything works fine until I try to call a function that requires parameters. Then the "vb engine" seems to for the functionname including the brackets.
The attached files contains a sample that works fine and another sample that does not work.

Please tell me if this behaviour is a bug or a feature.
0 Kudos
Message 1 of 4
(5,289 Views)
Hi,

Typically the command SCRIPTSTART is used as start parameter at DIAdem launch time like "DIAdem.exe /CScriptstart(VBName.VBS)". But to call a function or sub routine from a VBS file we recommend to use the command ScriptInclude. With this command it is possible to call functions and sub routines with parameter:

'Register all functions and procedures of Function_Library.vbs
Call ScriptInclude("Function_Library")

'Calling the function for calculating the maximum envelope curve
Call Calc_Envelope_Max(1,2)

More detailed information about this you can find in the DIAdem help.

I hope this solves your problem.

Kind regards

Walter Rick
0 Kudos
Message 2 of 4
(5,289 Views)
Thanks, for the quick answer.

Unfortunatelly, it does not help, because I have to create a menuitem tha call the function.
By the way, the documentation of "scriptstart" promissed that I could specify a function that is executed after the script is started. Please see the files attached to my first posting.

Furthermore there is a big difference in the behaviour of environment variables like "autoactpath" between calling a script via "scriptstart" or "scriptinclude".

So i am sure for my needs, I will have to use "scriptstart".

thanks
0 Kudos
Message 3 of 4
(5,289 Views)
Hi d.s.,

The Online Help is correct that you can specify a particular function inside a VBScript file when you execute the "ScriptStart()" command, but there is no way to pass local variables to that function inside the VBScript library. You can, however, declare and use global DIAdem variables to pass information back and forth. You can also turn your VBScript library into UserCommands so that no path information is needed and these functions are always available-- this would work fine from a menu.

Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 4 of 4
(5,289 Views)