SRL Archive - Discussions and Debates

Would it be possible and worth...


Camaro'

2008-05-12 21:39:50

Making a form that runs after runtime to display the proggy. And maybe has a Copy option.

EXample: Script finishes, but right before it ends the script call for this form which displays the proggy with a copy otion..

my question is would it be worth it and is it possible.:spot:

Bobarkinator

2008-05-12 22:25:45

Possible, in my opinion not worth it.

Widget

2008-05-13 18:20:28

program New;
var i:integer;
form:TForm;
Button:TButton;
procedure CloseForm(Sender:TObject);
begin
if (Sender=Button) then
Form.ModalResult := mrOk;
end;
Function TheForm:boolean;
begin
Form := CreateForm;
Form.SetBounds(0,0,500,200);
Form.Caption := 'Blah blah blah';
Form.Position := poScreenCenter;
Form.BorderStyle := bsExclusive;
Form.BorderIcons := [biSystemMenu];
Button := TButton.Create(Form);
Button.Parent := Form;
Button.SetBounds(50,50,50,20);
Button.Caption := 'Close';
Button.OnClick := @CloseForm;
result := Form.ShowModal=mrOk;
end;
procedure ScriptTerminate;
var v:TVariantArray;
begin
if ThreadSafeCall('TheForm',v) then
Writeln('Form closed from the button');
end;
begin
for i := 1 to 10 do
begin
writeln('I''m doing stuff! '+inttostr(i));
sleep(500);
end;
end.
You can also stop the script halfway through and it will come up.

Using ScriptTerminate with a repeat until false; loop is the shortest script that crashes scar that I know of :p