Hello,
I'm trying to understand why a simple script is apparently performing differently in JMP 8 and JMP 9. In brief, the script is supposed to allow the user to select the indexes of one, two or several contiguous items in a list box, and then clear the selection completely if more than one has been selected - which is what happens in JMP 8, but not in JMP 9, which appears to return just the highest index and then leaves the corresponding item selected. To see the problem, open the log, run the script and look at the resulting index list whenever more than one item is selected.
BoyList = {"Albert", "Bob", "Chris", "Duncan", "Eddie", "Fred", "Graham", "Hal"};
BoyScript = Expr(
SelectedBoys = BoyObject << GetSelectedIndices;
NBoys = N Items( SelectedBoys );
If( NBoys > 1,
For( i = 1, i <= NBoys, i++,
BoyObject << SetSelected( SelectedBoys, 0 )
)
);
);
MyWindow = New Window( "Test Window",
Panel Box( "Choice",
Text Box( "Select Boy(s)" ),
Lineup Box(
BoyObject = List Box(
BoyList,
BoyScript;
Show( SelectedBoys );
)
)
),
Button Box( "Stop",
MyWindow << CloseWindow;
Throw();
)
);
The above may or may not be a sensible way to script this, but I need to understand what's causing the difference. It looks to me as if the BoyScript expression is running recursively in JMP 9, but not in JMP 8 (which is the way I want it to run). Am I right, and if so, how can I stop it?
Many thanks