Subscribe Bookmark RSS Feed

Can't extract value from Number Col Edit Box - Cannot subscript Display Box in access or evaluation of 'Subscript'

gwenicat

Community Trekker

Joined:

Aug 28, 2014

Hello!

I'm writing my first script and I've hit a wall these last couple hours.

I am trying to extract a few items from a NLM platform to put in a report and while some items are easy to extract, the bits I need from Number Col Edit Boxes give me an error: I'm apparently not allowed to subscript them.

Here's the relevant bit of my script:

nlModel = Nonlinear(

  Y( :Name( "hGH" ) ),

  X( :Model ),

  Second Deriv Method( 1 ),

  Newton,

  Finish,

  Confidence Limits,

  Show Prediction Expression( 1 )

);

nlr = nlModel << Report;

pb = nlr[PictBox(1)];

modEq = pb << Get Image;

k = nlr[NumberColBox(18)][2];

//nceb = nlr[NumberColEditBox(18)];

//values = nceb << Get;

//k = values[2];

I've had no probs getting pictures but I cannot get numerical values.

The commented lines are my initial code, the line above is what was suggested in another post but did not work for me :-(

Any help in getting the estimate out would be appreciated,

Thanks

11325_pastedImage_1.png

3 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Looks like you are very close. So close that it's hard to tell without seeing the actual report you have.

Here's another example:

NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Nonlinear Examples/Algae Mitscherlich.jmp");

nlf = dt << Nonlinear( Y( :Algae density ), X( :Mitscherlich ), Finish );

nlfRep = nlf << Report;

nlfRep << showTreeStructure;                // Find out what display box to go after

est = nlfRep[NumberColBox(6)] << get;       // Get the estimated values into a list

AsTable(Matrix(est));                       // Make a table using this list

Print(est[1]);                              // Print a single estimate

gwenicat

Community Trekker

Joined:

Aug 28, 2014

Thanks Ian,

I worked around by getting the list in the Table containing my number col edit box and making that into a data table! Not the prettiest.

I've got to leave it for now, but I'll try your script and put more detail on mine if this still does not work.

ms

Super User

Joined:

Jun 23, 2011

Sometimes it can be easier to address a display box by its name. For example:

k=nlr[NumberColBox("Estimate")][2]