Jump to content
Neron

Restart Script

Recommended Posts

[sCAR]program ResetExample;

 

procedure MainLoop;

begin

Everything;

MainLoop; //Restart script

Exit; //Restart script

EverthingElse;

end;

 

begin

MainLoop;

end.[/sCAR]

That's actually not the best implementation, by recursing without using tail recursion, your stack will grow and overflow the memory if the script is repeated too often. It's better just to use a loop.

 

[scar]begin

repeat

...

until False;

end.[/scar]

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...