Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
vinkane
Level III

Having troulble with a dialog box script

Having troulble with a dialog box script to have the user select 1 or more selections, from a column of 100K rows. The column has no more then 6 different choices.

Thanks for the help

2 REPLIES 2
Highlighted
ian_jmp
Staff

Re: Having troulble with a dialog box script

Something like this, perhaps?

NamesDefaultToHere(1);

// Sample Character Data

dt = NewTable("Test Data", NewColumn("Column", Numeric, Nominal, Formula(RandomInteger(0, 10))), AddRows(10000));

dt << runFormulas;

Column(dt, "Column") << deleteFormula;

Column(dt, "Column") << dataType(Character);

// Dialog

distinctVals = AssociativeArray(Column(dt, "Column") << getValues) << getKeys;

nw = NewWindow("Select One or More Values",

lb = listBox(distinctVals, validateScript),

bb = ButtonBox("OK", OKscript, Enable(0))

);

// Validate script

validateScript =

Expr(

if(NItems(lb << getSelected) > 0, bb << Enable(1), bb << Enable(0));

);

// OK script

OKscript =

Expr(

nw << closeWindow; vals = lb << getSelected; Print(vals);

);

Highlighted
vinkane
Level III

Re: Having troulble with a dialog box script

Thanks....works well

Article Labels

    There are no labels assigned to this post.