DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I report the line with the error using custom error-handling?

Hello,

 

This might be simple, but I couldn't figure it out or find it in previous posts.

 

I am adding my own error-handling messages and I want to call out the line in which the different errors might occur. How can I accomplish this?

 

Thanks.

0 Kudos
Message 1 of 4
(2,837 Views)

Hi Kevin,

 

I am not sure if I am following your problem description, but I can do my best to help you with what I found on this topic. I assumed that you are referring to the DIAdem Script panel and that you are trying to manage your errors that can be generated in there. Could you share some screenshots of the error handling that you are setting on your system?

 

I know about the Err Object, this perhaps might be useful for you but I am not sure if you are already using it and having issues with it. Here you can find some information about the Object Err and an example of data reading using the Err object as error handling method.

 

I hope you can find this helpful, let us know if you have some other questions!

 

Warm Regards,

Regards,

Sil.VI
0 Kudos
Message 2 of 4
(2,791 Views)

Attached are pictures of one of the ways I'll deal with errors. In the first picture, where I call the function ErrorHandler(), I would like to have the number of the line where I call the function, in this case line 248, to be an input. I don't want to hard-code the line number, since that will change if I add or remove anything on previous lines. I'm looking for something that will just grab the current line the script is on at that moment.

 

This would allow me to show my own custom error messages and be able to tell whoever is running the script to "go to line X and makes Y changes" or whatever I want.

Download All
0 Kudos
Message 3 of 4
(2,784 Views)

Hi Kevin,

 

I am not aware of a VBScript function to do that.  Obviously the VBScript internal error handling is doing exactly that (for say, syntax errors), but I know of no way to achieve something similar with custom error messages.

 

Sorry,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(2,768 Views)