This is too simple to put to manufacturing floor but should give some possible ideas how you could approach this:
Names Default To Here(1);
dt = New Table("example",
Add Rows(4),
New Column("Batch", Numeric, Ordinal, Values([1,2,3,4]));
);
recode_batches = Expr(
aa_recode = Associative Array(ncb_batch << get, sceb_lot << get);
dt << New Column("Lot Number", Character, Nominal, << Set Each Value(
aa_recode[:Batch];
));
);
init_batches = Associative Array(:Batch) << get keys;
nw = New Window("Input",
H List Box(
Table Box(
ncb_batch = Number Col Box("Batch", init_batches),
sceb_lot = String Col Edit Box("Lot Number", Repeat({""}, N Items(init_batches))),
),
Panel Box("Actions",
Lineup Box(N Col(2),
Button Box("OK",
recode_batches;
nw << close window;
),
Button Box("Cancel", nw << close window)
)
)
)
);
Scripting Guide ( Scripting Guide > Display Trees > Construct Custom Windows > Constructors for New Windows ) and Scripting Index have lots of different options on how to build New Windows:
There are also quite a few things to consider when building something like this this. Below are few questions to think about:
- Should user be asked to fill batch -> lot information one by one? Or all at once (like my example)?
- What type of error situations there might be?
- If logging is needed, what type?
- Should the window be modal (block usage of JMP until OK / Cancel is pressed)?
- What will be done after new column has been created?
- How will this be shared? Add-in, script in network drive?
- How this will be modified in the future?
-Jarmo