ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/scriptengine/unit1.pas
(Generate patch)

Comparing ibx/trunk/examples/scriptengine/unit1.pas (file contents):
Revision 37 by tony, Mon Feb 15 14:44:25 2016 UTC vs.
Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC

# Line 6 | Line 6 | interface
6  
7   uses
8    Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 <  ComCtrls, ActnList, ExtCtrls, ibxscript, IBDatabase, IBHeader;
9 >  ComCtrls, ActnList, ExtCtrls, ibxscript, IBDatabase, IB;
10  
11   type
12  
# Line 35 | Line 35 | type
35      Timer1: TTimer;
36      procedure EchoInputChange(Sender: TObject);
37      procedure FormShow(Sender: TObject);
38 +    procedure IBDatabase1BeforeConnect(Sender: TObject);
39      procedure IBXScript1GetParamValue(Sender: TObject; ParamName: string;
40        var BlobID: TISC_QUAD);
41      procedure IBXScript1LogProc(Sender: TObject; Msg: string);
# Line 71 | Line 72 | begin
72    DBName.Caption := IBDatabase1.DatabaseName;
73    StopOnError.Checked := IBXScript1.StopOnFirstError;
74    EchoInput.Checked :=  IBXScript1.Echo;
75 <  Application.QueueAsyncCall(@DoOpen,0);
75 > //  Application.QueueAsyncCall(@DoOpen,0);
76 > end;
77 >
78 > procedure TForm1.IBDatabase1BeforeConnect(Sender: TObject);
79 > begin
80 >  with (Sender as TIBDatabase) do
81 >  begin
82 >    LoginPrompt := (Params.IndexOfName('user_name') = -1) or
83 >                   (Params.IndexOfName('password') = -1);
84 >  end;
85   end;
86  
87   procedure TForm1.EchoInputChange(Sender: TObject);
# Line 138 | Line 148 | begin
148   end;
149  
150   procedure TForm1.RunScriptExecute(Sender: TObject);
141 var S: TMemoryStream;
151   begin
152    ResultsLog.Lines.Clear;
153 <  S := TMemoryStream.Create;
145 <  try
146 <   IBScript.Lines.SaveToStream(S);
147 <   S.Position := 0;
148 <   IBXScript1.PerformUpdate(S,true);
149 <  finally
150 <    S.Free;
151 <  end;
153 >  IBXScript1.RunScript(IBScript.Lines);
154    Timer1.Interval := 1000;
155 +  EchoInput.Checked := IBXScript1.Echo;
156 +  StopOnError.Checked := IBXScript1.StopOnFirstError;
157 +  DBName.Caption := IBDatabase1.DatabaseName;
158   end;
159  
160   procedure TForm1.RunScriptUpdate(Sender: TObject);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines