Close the PUB and Run it again from start?

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Locked
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Close the PUB and Run it again from start?

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

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

Post 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
Hans-Peter
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

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

Post 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".
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

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

Post by Dudus »

Thank you! I found this option: RunNeoBook "[PUbDir]\mypub.exe" "ClearVars+CloseWindows"
Its works great! :)
Locked