- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Combining Number Edit Boxes
I am using Number Edit Boxes to get user input in a JMP 13 script, like this:
New Window( "A", Modal, neb1 = Number Edit Box( 1 ) );
A = neb1 << get;
New Window( "B", Modal, neb2 = Number Edit Box( 2 ) );
B = neb2 << get;
New Window( "C", modal, neb3 = Number Edit Box( 3 ));
C = neb3 << get;
I would like to combine them into a single box with one "OK" button. The manuals don't seem to cover this, or I don't understand. Can anyone help?
Thanks.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
Combine them into one New Window call:
New Window( "Get Numbers", << modal(),
hlistbox(
textbox("Enter value for A: "),
neb1 = Number Edit Box( 1 ),
),
hlistbox(
textbox("Enter value for B: "),
neb2 = Number Edit Box( 2 ),
),
hlistbox(
textbox("Enter value for C: "),
neb3 = Number Edit Box( 3 ),
),
ok_btn = button box("OK",
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
),
);
print(a, b, c);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
NumberEditBox is an example of a display box. You can put multiple display boxes in a window by separating them with a comma.
New Window("ABC", <<Modal,
neb1 = Number Edit Box( 1 ),
neb2 = Number Edit Box( 1 ),
neb3 = Number Edit Box( 1 ),
);
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
For further composition you can use display boxes that control layout: V List Box, H List Box, Lineup Box:
nw = New Window("ABC", <<Modal,
Lineup Box(NCol(2),
Text Box("A: "), neb1 = Number Edit Box( 1 ),
Text Box("B: "), neb2 = Number Edit Box( 1 ),
Text Box("C: "), neb3 = Number Edit Box( 1 ),
)
);
If (nw["Button"]==-1,
Throw() // user cancelled
);
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
show(A,B,C);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
Combine them into one New Window call:
New Window( "Get Numbers", << modal(),
hlistbox(
textbox("Enter value for A: "),
neb1 = Number Edit Box( 1 ),
),
hlistbox(
textbox("Enter value for B: "),
neb2 = Number Edit Box( 2 ),
),
hlistbox(
textbox("Enter value for C: "),
neb3 = Number Edit Box( 3 ),
),
ok_btn = button box("OK",
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
),
);
print(a, b, c);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
NumberEditBox is an example of a display box. You can put multiple display boxes in a window by separating them with a comma.
New Window("ABC", <<Modal,
neb1 = Number Edit Box( 1 ),
neb2 = Number Edit Box( 1 ),
neb3 = Number Edit Box( 1 ),
);
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
For further composition you can use display boxes that control layout: V List Box, H List Box, Lineup Box:
nw = New Window("ABC", <<Modal,
Lineup Box(NCol(2),
Text Box("A: "), neb1 = Number Edit Box( 1 ),
Text Box("B: "), neb2 = Number Edit Box( 1 ),
Text Box("C: "), neb3 = Number Edit Box( 1 ),
)
);
If (nw["Button"]==-1,
Throw() // user cancelled
);
A = neb1 << get;
B = neb2 << get;
C = neb3 << get;
show(A,B,C);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
And I quickly get 2 usable answers! I love the JMP community!
Other than the included Scripting Guide, or Jump into JMP Scripting is there a manual that covers scripts? Hopefully with lots of examples?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
Another book to recommend is JSL Companion: Common Applications of the JMP Scripting Language. It is, just as you asked, full of examples of real world tasks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Combining Number Edit Boxes
Here is a detailed example scenario that you can work through:
(links to an external website: a blog I maintain for JMP/JSL discussions)