-
Notifications
You must be signed in to change notification settings - Fork 140
/
runscriptDlg.pas
47 lines (38 loc) · 918 Bytes
/
runscriptDlg.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
unit runscriptDlg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TrunScriptFrm = class(TForm)
resultBox: TMemo;
Panel1: TPanel;
runBtn: TButton;
autorunChk: TCheckBox;
sizeLbl: TLabel;
procedure runBtnClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
runScriptFrm: TrunScriptFrm;
implementation
{$R *.dfm}
uses
main, utilLib, classesLib, scriptLib;
procedure TrunScriptFrm.runBtnClick(Sender: TObject);
var
tpl: Ttpl;
begin
tpl:=Ttpl.create;
try
try
tpl.fullText:=loadTextFile(tempScriptFilename);
resultBox.text:=runScript(tpl[''], NIL, tpl);
sizeLbl.Caption:=getTill(':', sizeLbl.Caption)+': '+intToStr(length(resultBox.text));
except on e:Exception do resultBox.text:=e.message end;
finally tpl.free end;
end;
end.