How to terminate a script with a keyboard?

Ask questions about how to create a script or swap scripts with other users.
Post Reply
User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

How to terminate a script with a keyboard?

Post by pjj »

Is there a way to break a script in the mid-run? I for one haven't run in a situation that would require this ;) but I can easily imagine such a scenario... Then what? Is there any other way than to kill RJ TE? If not, would it be possible to add such a feature?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: How to terminate a script with a keyboard?

Post by pjj »

Image

I just run into one of these cases, hiding the main form :roll: so no way to close the app window other then killing RJ TE :roll: So, is it possible?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: How to terminate a script with a keyboard?

Post by pjj »

And no, "Exit Script (Shift+Esc)" doesn't work for me.

Here's a somewhat contrived sample of situation when you'd need it:

Code: Select all

function hideForm()
{
  d.hide;
//  d.ModalResult = mrOk;
}

d = new TForm(nil);
d.Caption = "Prepare to kill RJ TE";
d.BorderStyle = bsDialog;
d.Position = poScreenCenter;
d.Width = 165;
d.Height = 65;

// OK button
ok = new TButton(d);
ok.Parent = d;
ok.SetBounds(30, 5, 100, 25);
ok.Caption = "Go for it!";
ok.OnClick = &hideForm;

// show the main dialog
d.ShowModal;
d.Free;
It could be a long/infinite loop as well, when you'd want "Exit Script" to work.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: How to terminate a script with a keyboard?

Post by pjj »

Image

Any chance you look into it someday soon? I could really, really use it, you know. Perhaps other people could, too ;)
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

Post Reply