cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
KinKame
Level IV

list box and iteration

Hello,

I have a reporting showing data and structured as below:

H1 = H list box(

         V1 = V list box() / V2 = V list box() / V3 = V list box() / V4 = V list box()

);

Is there a wait to script this type of structure using iteration as all the V list box are identical.

I tried to use H1 << append (vi) method but it is not working.

 

best regards

Lionel 

 

5 REPLIES 5
txnelson
Super User

Re: list box and iteration

Here is an example of how to do what I think you want, by using a JMP list as the structure that will allow iteration

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

// iteration list
iList = {};

// Create a display window
NW = New Window( "Test", ob = Outline Box( "Results" ) );

// Create multiple V List Boxes and add them to the display window
For( i = 1, i <= 4, i++,
	V = V List Box( Text Box( "V List " || Char( i ) ) );
	ob << append( V );
	// Place the handle for each of the V List Boxes into the list
	Insert Into( iList, V );
);

// Now add to the display window by referencing the V List Box of choice
iList[2] << append( Bivariate( x( dt:Height ), y( dt:Weight ) ) );
iList[4] << append( Bivariate( x( dt:Age ), y( dt:Weight ) ) );
Jim
KinKame
Level IV

Re: list box and iteration

thank you and sorry for my late reply. Looks ok for me to try it :) 

Re: list box and iteration

Here is a way to obtain the original result, although I prefer Jim's approach.

New Window( "Test",
	hlb = H List Box()
);

For( b = 1, b < 5, b++,
	hlb << Append(
		Eval(
			Parse(
				Substitute(
					"vlb nnn = V List Box( Text Box( \!"Here I am!\!") )",
					"nnn",
					Char( b )
				)
			)
		)
	)
);
KinKame
Level IV

Re: list box and iteration

thank you for your reply. doesnt look like so complicated :)

Re: list box and iteration

It never does - when you know the answer!

The key point is that we need to make a specific script as expressions or character strings and then evaluate them when they are ready. That practice is not common in programming.