cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
lwx228
Level VIII

How do I ignore errors and let the loop continue while executing a loop in JSL?

When an error occurs in a loop during a JSL execution, how do Let the JSL to automatically ignore the error and proceed to the next loop and continue?

 

Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How do I ignore errors and let the loop continue while executing a loop in JSL?

The easiest way to handle this is to use the Try() function.

 

It allows you to return a value if the statement(s) within the Try() function have an error.  You can then detect the error and handle it the way it needs to be handled.

See the Try() function in the Scripting Index for definition and example

Jim

View solution in original post

3 REPLIES 3
lwx228
Level VIII

Re: How do I ignore errors and let the loop continue while executing a loop in JSL?

This code is available in VBA:
On Error GoTo ,


but I haven't found similar functionality in JSL.
txnelson
Super User

Re: How do I ignore errors and let the loop continue while executing a loop in JSL?

The easiest way to handle this is to use the Try() function.

 

It allows you to return a value if the statement(s) within the Try() function have an error.  You can then detect the error and handle it the way it needs to be handled.

See the Try() function in the Scripting Index for definition and example

Jim
lwx228
Level VIII

Re: How do I ignore errors and let the loop continue while executing a loop in JSL?

OK、Thank Jim!2019-09-28_10-27-54.png