Choose Language Hide Translation Bar
Highlighted
AdamChoen
Level III

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 

 

Thanks, Adam
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

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 ) ) ),
	"not found"
);
If( dis == "not found",
	Dialog( "No Table Produced" )
);

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

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

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
AdamChoen
Level III

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" ? 

Thanks, Adam
Highlighted
txnelson
Super User

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 ) ) ),
	"not found"
);
If( dis == "not found",
	Dialog( "No Table Produced" )
);

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

View solution in original post

Highlighted
AdamChoen
Level III

Re: Bivariate list condition

Ok! so that can definitely help.
Thanks! 

Thanks, Adam
Article Labels

    There are no labels assigned to this post.