BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
robot
Community Trekker

Determine if a Display Tree Branch Exists

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!

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User ms
Super User

Re: Determine if a Display Tree Branch Exists

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 ))

0 Kudos
2 REPLIES 2
ms
Super User ms
Super User

Re: Determine if a Display Tree Branch Exists

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 ))

0 Kudos
robot
Community Trekker

Re: Determine if a Display Tree Branch Exists

Works great!  Thanks!

0 Kudos