Source language: Translate to:

Close the PUB and Run it again from start?

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Close the PUB and Run it again from start?

Postby Dudus » Sat Dec 16, 2017 5:35 am

Hi,

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

Thank you!
Dudus
User avatar
Dudus
 
Posts: 118
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

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

Postby HPW » Sat Dec 16, 2017 5:58 am

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
Hans-Peter
User avatar
HPW
 
Posts: 2526
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

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

Postby Gaev » Sat Dec 16, 2017 7:54 am

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".
User avatar
Gaev
 
Posts: 3748
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

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

Postby Dudus » Sun Dec 17, 2017 3:44 am

Thank you! I found this option: RunNeoBook "[PUbDir]\mypub.exe" "ClearVars+CloseWindows"
Its works great! :)
User avatar
Dudus
 
Posts: 118
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest