DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Catch Error in ScriptStart files

 
 
Hi there,
 
My problem is to trace an error from a file which is executed through scriptstart() command.
 
The scenario is my vbs file(say my.vbs) will try to execute a user created scriptfile through scriptstart() say user.vbs, but we are unable to catch any errors that would  of error that may occur in user.vbs since it is been created by users. Can anyone let me know if there is a means to trap an error in this case.
 
I have tried putting On error resume next in my.vbs but the control is out of our file hence no use, also I tried copying the contents of user.vbs into a newly created file which error handler statement on the first line but the contents are getting copied in the binary format so I am unable to get a solution here.
 
Can anyone please help me out.
 
Thanks,
Priya
0 Kudos
Message 1 of 2
(3,001 Views)

Hi Priya,

Try the global DIAdem error handling that I just posted for you for the OLE Automation case-- it may well work in this scenario also, since it is not limited in scope to either the calling script or the ScriptStarted() script.

I am much more familiar with the native VBScript "On Error" error handling, so I'm not certain if the global DIAdem error handling will work for you, but it should, as this used to be all there was in older versions of DIAdem before VBScript was tha automation language.  I vastly prefer to use ScriptInclude() so that the subroutines refereced execute in the parent script's scope, but this does require that the referenced code be created as a series of functions or subroutines, as opposed to having the code directly in the called script.  You may not have that kind of influence over your users.

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 2
(2,982 Views)