Hi everyone,
I wrote a tiny script to call script subroutines. This one works as a shell for other scripts, everything fine so far.
But, when I hit the window button "x" to close that shell window, without or after having pushed a button, it always runs one of the called routines ("Setup") ...
Any idea, where I am messing up?
Let>APP_TITLE=DARP SHELL
Dialog>MyDialog
Caption=DARP Shell
Width=653
Height=250
Top=104
Left=16
Button= ,288,24,185,73,1,%SCRIPT_DIR%\Orders.bmp,Ruft Bestellungen ab / Picking orders
Button= ,288,112,185,73,2,%SCRIPT_DIR%\setup.bmp,Einstellungen vornehmen / Set it up
Image=,448,288,105,105
EndDialog>MyDialog
Show>MyDialog,result
If>result=1,Email-Orders
If>result=2,Setup
SRT>Setup
Macro>%SCRIPT_DIR%\setup.scp
END>Setup
SRT>Email-Orders
Macro>%SCRIPT_DIR%\order_email_holen.scp
End>Email-Orders
Show>MyDialog,result
Shell script runs subroutine when supposed to close
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 68
- Joined: Wed Dec 07, 2005 7:13 am
-
- Pro Scripter
- Posts: 68
- Joined: Wed Dec 07, 2005 7:13 am
Where would I find more info of that kind?
Thanks!! That helps.
Where would I find a detailled list, concerning system window-values? I immediately checked the help under System Variables, but it did not contain this info. Where else could it be found?
Appreciate the help. Thank you very much.
Where would I find a detailled list, concerning system window-values? I immediately checked the help under System Variables, but it did not contain this info. Where else could it be found?
Appreciate the help. Thank you very much.
Thanks Rain... that's another good one to remember. I think I've seen other posts from users having problems with using 2 for something else before. "Clicking X on the dialog produces a 2"... That's important to know so I thought this info would be in the Help file in the "dialog" topic... so I checked and see the examples there do use 2 as the value to "End" or "exit" but I can't see where it says clicking the X on the dialog produces a 2.Rain wrote:If>result=2,Setup
2 is always used by the X button.
Add another button for the Setup subroutine.
If>result=1,Email-Orders
If>result=2,Exit
If>result=3,Setup
Marcus, did I miss this or is it mentioned somewhere else in the Help file? If not, could a note to this effect be added to the "dialog" topic in the Help file (and on-line Help)? Please and thanks.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
In the Help for GetDialogAction it says:
"When the dialog is closed r is set to 2."
The value of r is always reset to 2.
The value of r only changes when a button is clicked.
I agree that it is not SHOUTING out what happens. And the Non-Modal example of Help for Dialog does show the values for the two buttons (5,6) with the value of 2 also added.
So the rule of thumb is that any time you are using buttons, you should include the value of 2 for exiting. You can still have an Exit Button with the value of 2 to provide a "normal" exit method.
"When the dialog is closed r is set to 2."
The value of r is always reset to 2.
The value of r only changes when a button is clicked.
I agree that it is not SHOUTING out what happens. And the Non-Modal example of Help for Dialog does show the values for the two buttons (5,6) with the value of 2 also added.
So the rule of thumb is that any time you are using buttons, you should include the value of 2 for exiting. You can still have an Exit Button with the value of 2 to provide a "normal" exit method.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Thanks Bob for the above.Bob Hansen wrote:In the Help for GetDialogAction it says:
"When the dialog is closed r is set to 2."
The value of r is always reset to 2.
The value of r only changes when a button is clicked.
I agree that it is not SHOUTING out what happens. And the Non-Modal example of Help for Dialog does show the values for the two buttons (5,6) with the value of 2 also added.
So the rule of thumb is that any time you are using buttons, you should include the value of 2 for exiting. You can still have an Exit Button with the value of 2 to provide a "normal" exit method.
It seems to me that if a new user were building a script using the Non-Modal dialog example in the "dialog" Help topic, that uses the GetDialogAction> command so, if they read about that in Help, they should see the line...
- When the dialog is closed r is set to 2.
However, if the new user used the Modal example in the Help file "dialog" topic... that doesn't use GetDialogAction> so they may not realize that 2 is "hard-coded" into the behavior of every dialog... and that clicking the Windows X Close button actually generates a 2.
The fact that we occasionally see posts like this one is proof users sometimes miss this.
However, if a line was added right into the "dialog" topic in the Help file to explain it, I believe it would help new users with this... just my opinion.
Thanks for the detailed reply and take care.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This is made clear in the topics for Show and GetDialogAction. These are the only functions which return this result. That's why this is stated in these topics. However, a note will be added in the Dialog topic also.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Thanks Marcusmtettmar wrote:a note will be added in the Dialog topic also.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -