Re: Delphi command like restart or something like that

Posted by Rupert on July 07, 2005 :

In Reply to: Command like restart; or something like

: Im trying to make a simple menu with just New and Exit

: I know how the command i should use for Exit, just Close;

: But is there also a command that restarts the whole program, like Restart; or something like that?

Delphi has no command such as "Restart".

But what do you mean with "Restart"? Destroy all the forms, and create them again? Why would you want to do that?

If it's only to re-initialize the main form and some variables, you can do that in another way. Suppose that you do some stuff in the OnCreate event handler of the main form; well, put all that stuff in a separate procedure such as:

procedure Form1.InitMain;

You call that procedure from the OnCreate handler. And when you want to re-initialize, you also call that procedure :)

Related Articles and Replies

Home   FAQ