# Opening a Natural Dialog from a program

**URL:** <https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-on-Windows-Unix\
**Created:** [March 24, 2006, 3:15am UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706 "2006-03-24T03:15:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 24, 2006, 3:15am UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/1 "2006-03-24T03:15:10Z")

</div>

Is there a way to open a Natural Dialog, or more specifically a GUI popup window from a Natural program.

The Messagebox appears to be a GUI window and this can be run from a Natural program so I thought there might be a way to do this with other GUI windows.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 24, 2006, 9:44pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/2 "2006-03-24T21:44:49Z")

</div>

Of course, the OPEN DIALOG statement does this for you 😉

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [March 27, 2006, 12:10pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/3 "2006-03-27T12:10:50Z")

</div>

> [@Wolfgang Winter](#):
>
> Of course, the OPEN DIALOG statement does this for you 😉

Can you give more details calling from a PROGRAM:  
What do you use as PARENT parameter?  
How do you get over the “NAT6157 Dialog called from non-gui environment”?

With 6.1 I know only the possibility calling via STACK TOP COMMAND.

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [March 27, 2006, 12:35pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/4 "2006-03-27T12:35:25Z")

</div>

You have to initiate your session with a dialog if you want to open a dialog with OPEN DIALOG. The initial dialog should call your starting program and then you can do everything you want to as a GUI context has been set up.

---

<div class="post-metadata">

**Author:** ![Henrik\_Hermansen1](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@Henrik\_Hermansen1](https://techcommunity.softwareag.com/u/Henrik_Hermansen1)\
**Post date:** [March 27, 2006, 2:44pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/5 "2006-03-27T14:44:22Z")

</div>

If you don’t mind leaving your current program you can use the stack command:

STACK TOP COMMAND ‘Progname’

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [March 27, 2006, 3:28pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/6 "2006-03-27T15:28:32Z")

</div>

> [@Henrik Hermansen](#):
>
> If you don’t mind leaving your current program you can use the stack command:  
> STACK TOP COMMAND ‘Progname’

… and come back (old NAT1.x way to make loops)

STACK TOP COMMAND \*PROGRAM  
STACK TOP COMMAND ‘myDialog’  
STOP

:roll:

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [March 27, 2006, 3:32pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/7 "2006-03-27T15:32:05Z")

</div>

[quote="Wilfried B

---

<div class="post-metadata">

**Author:** ![Chofo](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/chofo/32/119_2.png) [@Chofo](https://techcommunity.softwareag.com/u/Chofo)\
**Post date:** [March 27, 2006, 9:50pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/8 "2006-03-27T21:50:24Z")

</div>

Hi, i do this with this instruction:

Run ‘Dialog Name’

works very nice… (not necesary parameters)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 28, 2006, 3:52am UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/9 "2006-03-28T03:52:16Z")

</div>

Thanks for all your help.

The OPEN DIALOG statement did not work for me – I get the 6157 error.

The STACK would certainly work but difficult in the application I have in mind.

The RUN statement – I will have to try this one – I had not thought of it.

I ultimately rewrote the Program as a Dialog but did not display any GUI screen – from there I was able to display the GUI popup window I had originally intended.

Thanks again.

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [March 30, 2006, 12:08pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/10 "2006-03-30T12:08:32Z")

</div>

[quote="Weihnachtsb

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 31, 2006, 4:34am UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/11 "2006-03-31T04:34:37Z")

</div>

Thanks Wilfried. That will be useful next time I have this problem. I am working on a legacy system so this will occur again.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/opening-a-natural-dialog-from-a-program/60706/12 "2021-04-02T14:40:31Z")

</div>


