DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a function with parameters in ScriptStart function

i am trying to call ScriptStart function from SUD dialog. This is how iam calling Call ScriptStart(path & "test.vbs","abc") abc is function which is written test.vbs. It is working. But when i want to pass some parameters to the abc function of test.vbs. It is not working why. can anybody suggest where i went wrong. I am calling the same function as Call ScriptStart(path & "test.vbs","abc(" & text1.Text & ")"). It is not working why ? Is the ScriptStart function only point to functions. it does not take any parameters or waht ?
0 Kudos
Message 1 of 3
(8,100 Views)
This is correct, the second parameter of the scriptstart command is to call procedures, not functions. It does not support the transmission of parameters to a subroutine.

I would recommend to use usercommands, here you may pass parameters.

Ingo Schumacher
National Instruments
0 Kudos
Message 2 of 3
(8,100 Views)
Hi abc421,

Another option in addition to UserCommands would be to use ScriptInclude(path). If you execute a ScriptInclude(path) command at the beginning of your VBScript, then all the functions and Subs in the VBscript located at "path" are now available to you-- including passing parameters and receiving return values from functions. If you are calling a VBscript that uses only VBScript variables, then this is the preferred method.

If instead you are calling a VBScript that uses global DIAdem variables declared in a VAS file (their variable names all end with the "_" character), then those parameters are already available at the subroutine called with ScriptStart(path, routine).

Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(8,100 Views)