Page 1 of 1

Close the PUB and Run it again from start?

PostPosted: Sat Dec 16, 2017 5:35 am
by Dudus
Hi,

is there any way to close the Pub.exe with a button (like exit) and Execute (run) it again automatically?

Thank you!
Dudus

Re: Close the PUB and Run it again from start?

PostPosted: Sat Dec 16, 2017 5:58 am
by HPW
From the doc
Exit
Purpose:
Exit the publication with an optional confirming dialog box.
Category:
Messages/Interaction
Syntax:
Exit "title" "message"
title
The dialog box title.
message
The dialog box message. Line breaks can be entered using the pipe character “|”.
Leave the title and message fields blank to exit immediately without requesting confirmation.
Example:
Exit "Good-Bye" "Do you really want to quit?"


The Restart is not possible. It must come from outside other exe.Maybe you can create another exe which gets called on shutdown which gets the exe-Name via commandline which does nothing other then starting the exe-Name.
Regards

Re: Close the PUB and Run it again from start?

PostPosted: Sat Dec 16, 2017 7:54 am
by Gaev
Dudus:

In addition to suggestion by Hans-Peter ...

1) take a look at the Help file information for the RunNeoBook command.

2) consider starting the second copy just BEFORE exiting the first (currently running) copy of the Application ...

a) as long as you have NOT configured your Application to only run one copy of it at any one time, you can do a Run of Pub.exe just BEFORE you invoke the Exit command.

b) if you have configured your Application to only run one copy of it at any one time, keep two identical copies of the same Application (e.g. Pub1.exe and Pub2.exe) and do a Run of Pub2.exe just BEFORE you invoke the Exit command in Pub1.exe (and do a Run of Pub1exe just BEFORE you invoke the Exit command in Pub2.exe

In both cases, there will be a split second when both copies exist (but your user will not be able do anything with the first copy after clicking on the Ext Button) ... you can further improve the visual (so as not to confuse the user even for a split second) by first setting the variable [WindowState] to "Minimized".

Re: Close the PUB and Run it again from start?

PostPosted: Sun Dec 17, 2017 3:44 am
by Dudus
Thank you! I found this option: RunNeoBook "[PUbDir]\mypub.exe" "ClearVars+CloseWindows"
Its works great! :)