Subscribe Bookmark RSS Feed

Determine if a Display Tree Branch Exists

robot

Community Trekker

Joined:

Feb 27, 2012

Hi,

I would like to script a JSL command to close a branch of a display tree.  My problem is, depending on circumstances, sometimes this branch will exist, and other times it will not.  If the command to close the branch is sent, and that branch does not exist, the user gets an error.  I imagine one possible solution is to write an IF statement to determine if the branch exists; if yes, close that branch; if no, ignore the that command and move on.  Does anyone have any recommendations?  I am using JMP9.

/*

// My fantasy code...

If(

     Exists( report[Outline Box( 6 )]) == 1, report[Outline Box( 6 )] << Close( 1 );

);

*/

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ms

Super User

Joined:

Jun 23, 2011

Solution

Try Try! If the expression returns an error it is ignored and the script execution moves on as if nothing has happened.

Try(report[Outline Box( 6 )] << Close( 1 ))

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

Solution

Try Try! If the expression returns an error it is ignored and the script execution moves on as if nothing has happened.

Try(report[Outline Box( 6 )] << Close( 1 ))

robot

Community Trekker

Joined:

Feb 27, 2012

Works great!  Thanks!