Page 1 of 1

Procedure to force "restart" of application...

Posted: Fri Nov 01, 2019 4:57 pm
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.

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

Posted: Fri Nov 01, 2019 5:09 pm
by Kiffi

Code: Select all

RunProgram(ProgramFilename())
End

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

Posted: Fri Nov 01, 2019 9:20 pm
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?

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

Posted: Fri Nov 01, 2019 9:54 pm
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