Procedure to force "restart" of application...

Everything else that doesn't fall into one of the other PB categories.
Dudemeister
User
User
Posts: 29
Joined: Sat Oct 26, 2019 6:48 pm

Procedure to force "restart" of application...

Post by Dudemeister »

Does anyone know of either a built-in PB procedure, or possibly even a custom procedure, to force a restart of an application? Say... for when the end-user changes an application option that will require a restart for that change to take effect.
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Procedure to force "restart" of application...

Post by Kiffi »

Code: Select all

RunProgram(ProgramFilename())
End
Hygge
Dudemeister
User
User
Posts: 29
Joined: Sat Oct 26, 2019 6:48 pm

Re: Procedure to force "restart" of application...

Post by Dudemeister »

Just to be clear before I do anything which might prove how unskilled I truly am...

Is the 'RunProgram()' procedure for executing an external program, or for restarting the current program? Or, perhaps both?
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 617
Joined: Mon May 09, 2011 9:36 am

Re: Procedure to force "restart" of application...

Post by VB6_to_PBx »

Dudemeister wrote:Just to be clear before I do anything which might prove how unskilled I truly am...

Is the 'RunProgram()' procedure for executing an external program, or for restarting the current program? Or, perhaps both?

Code: Select all

 RunProgram(ProgramFilename()) : End ;<<--- will completely restart your program
RunProgram() can also execute external programs + other things


in my program , i use this below to restart my program , but not from scratch
because i just want to clear all [ClearAll(0) procedure] choices and variables
and because i have EULA Agreement Window + License Window that pops up
when i 1st run my Program ... so to stop those 2 Windows from starting up if i just want to simply Restart with "New File" choice
i use this method instead :

Code: Select all

Case 5 ;-[ 5 ] New File - Restart Program to clear everything
          ClearAll(0) : MainWindow()  ;<<--- RunProgram(ProgramFilename()) : End ; another way to restart entire program

MainWindow() ... can be like calling your Window_0 or Window_1 main Procedure to start all over again without actually ending your Program
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
Post Reply