Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Combining Number Edit Boxes

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 30, 2016 7:53 AM
(5613 views)

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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);
```

-Dave

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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);
```

-Dave

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- 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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- 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.

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- 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)

-Dave