cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
samir
Level IV

How to use scrollBox

Hello,

I put a few strings in a scroll box in view of selecting one and using it later in the script...But I see no way to get the string that is selected by the user.

Example: in the following script we get a list of strings "first Item", "Second Item", ...

Once the user selects the "Second Item", how can I extract this information ?

Thanks a lot.

Names Default To Here( 1 );
win = New Window( "Example",
	sb = Scroll Box(
		Size( 250, 75 ),
		List Box(
			{"First Item", "Second Item", "Third Item", "Fourth Item",
			"Fifth Item"},
			width( 200 ),
			max selected( 2 ),
			nlines( 6 )
		)
	)
);
win << Set Window Size( 300, 200 );
2 REPLIES 2
txnelson
Super User

Re: How to use scrollBox

You need to add a pointer to the actual list box().  Then you can access the various items/features you want.  See my script below.  All of this is available in the scripting index

     Help==>Scripting Index

Names Default To Here( 1 );
win = New Window( "Example",
	sb = Scroll Box(
		Size( 250, 75 ),
		lb = List Box(
			{"First Item", "Second Item", "Third Item", "Fourth Item",
			"Fifth Item"},
			width( 200 ),
			max selected( 2 ),
			nlines( 6 ),
			show(lb<<get selected);
		)
	)
);
win << Set Window Size( 300, 200 );
Jim
samir
Level IV

Re: How to use scrollBox

You are right,

I did not think of pointing to the list itself...And the "get selected" does the job.

Many thanks.

Recommended Articles