Choose Language Hide Translation Bar
Highlighted

## Bivariate list condition

hi

I'm looking for a condition to start a loop that handles the Bivariate title,

I found one that works only if I have more the 1 chart.

``````lst = dt << Bivariate(
.
.
.
.
);

If(IsList(lst) & (nn = NItems(lst)),
For(i = 1, i <= nn, i++,
.
.
.
.
);``````

I cant find a condition to distinguish between 0 (no chart == dt table is empty) to  1 (only one chart is created).

any help is welcomed

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

## Re: Bivariate list condition

The Try() function can be used in many, many ways to keep code from failing, and also to determine is code was properly executed.  Here is just one simple way to illustrate it's use

``````Names Default To Here( 1 );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
);
Dialog( "No Table Produced" )
);

dt = Open( "\$SAMPLE_DATA/Big Class.jmp" );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
);
Dialog( "No Table Produced" )
);``````
Jim
4 REPLIES 4
Highlighted

## Re: Bivariate list condition

Your description is a bit vague to suggest specific solutions.  I suggest you look into

isEmpty(),

N Cols()

and

Try()

as potential functions that can detect the missing charts.

Jim
Highlighted

## Re: Bivariate list condition

thanks, Jim
Eventually I used a simple condition Nrows(dt) > 0 to check if the table is empty, not the smartest one but it works.

how can i use the try() function to check if i have 1 or 0 charts in my parameter "lst" ?

Highlighted

## Re: Bivariate list condition

The Try() function can be used in many, many ways to keep code from failing, and also to determine is code was properly executed.  Here is just one simple way to illustrate it's use

``````Names Default To Here( 1 );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
);
Dialog( "No Table Produced" )
);

dt = Open( "\$SAMPLE_DATA/Big Class.jmp" );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
);
Dialog( "No Table Produced" )
);``````
Jim
Highlighted

## Re: Bivariate list condition

Ok! so that can definitely help.
Thanks!