Hi, I am having some trouble sending some information to a report after it gets generated. The report contains multiple distributions, which are created in a for loop with index i. Each distribution is contained within its own outline box so that I may add lots of other stuff within each outline box and have relevant material grouped together. I store a reference to each of these distributions (called distObj), and I can change them by addressing them as distObj[1] << ... etc, but here's the catch: I am using radio boxes located within the report, one set of 3 radio boxes per outline box (i.e. per Distribution). Clicking on different radio buttons will scale the axes for the i'th parameter only in 1 of 3 different manners. After the script is completed, the variable i is no longer mapped to each box as it was for each iteration of the for because it has incremented to its final value. I need to figure out which set of buttons was clicked (essentially, what was 'i'), and send limit scaling information to the corresponding distribution only. I've verified that it works if I hardcode the subcript but that really won't work.
I've tried a few things, like writing a number edit box with the number i, so that i actually gets stored in the report., but I still run into problems trying to get that specific variable (it needs to be subscripted too).
There's something in the scripting guide that I think can help me, but I don't know how to use it. Page 335 of JMP 10's scripting guide, Display Trees chapter, Subscripts. They suggest that for a display box db, JSL can find an object with "text" by using the code db["text"] or db["text?"] using the ? as a wildcard. The reason I think this can help me is that instead of relying on a subscript for the i'th parameter, i would just find a match based on distObj. I am hoping to get it so the radio button sends a command to find and walk up one node to the outline box (or stay in the same node as it may be), get the proper db reference and send the command from there. I have tried to get this to work, but I have to wonder if I'm barking up the wrong tree with this one.
Here is the relevant part of my script. In the radio box section, the "stored_i" variable may as well just be "i". It was a test that didn't really work.
Any ideas?
custRpt = New Window( titleString,
AnaNotesBox = Outline Box("Analysis Notes",
Text Box( textString1),
)
);
distObj={};
rb1 = {};
rb2 = {};
rb3 = {};
paramBoxList ={};
For( i = 1, i <= AdjNumParam, i++,
custRpt << append(
ParamBoxList = Outline Box( newYparamName ,
V List Box(
hlistbox(
rb1 = radioBox("Scale method 1 ", show("test1");stored_i = numBox << Get(numeric value);show(stored_i); // <-- numbox is just
distObj[stored_i] << SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Min( newMin[stored_i],newLSL[stored_i]), Max( newMax[stored_i],newUSL[stored_i]), Inc( 2 ),
Minor Ticks( 1 ), Rotated Labels( "Horizontal" )}
));
),
rb2 = radioBox("Scale method 2 ", stored_i = numBox << Get(numeric value);
distObj[stored_i] << SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Min( newMin[stored_i] ), Max( newMax[stored_i] ), Inc( 2 ),
Minor Ticks( 1 ), Rotated Labels( "Horizontal" )}
));
),
rb3 = radioBox("Scale method 3 ", stored_i = numBox << Get(numeric value);
distObj[stored_i] << SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Min( newLSL[stored_i] ), Max( newUSL[stored_i] ), Inc( 2 ),
Minor Ticks( 1 ), Rotated Labels( "Horizontal" )}
));
),
numBox = Number edit box(i),// <-- numBox not subscripted so this won't work
//stored_i = numBox << Get(numeric value)
//numParam = numParamVal << Get(numeric value);
),
rb1 << group (rb2) << group(rb3),
H List Box(
distObj = Distribution(
Y( Eval List( newYparamName ) )),
),
page break box();
)
)
);
);