forked from perevoznyk/php4delphi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUnit1.pas
53 lines (44 loc) · 1.31 KB
/
Unit1.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
48
49
50
51
52
53
{*******************************************************}
{ PHP4Delphi }
{ PHP - Delphi interface }
{ Author: }
{ Serhiy Perevoznyk }
{ serge_perevoznyk@hotmail.com }
{ http://users.chello.be/ws36637 }
{*******************************************************}
unit Unit1;
{ $Id: Unit1.pas,v 7.0 04/2007 delphi32 Exp $ }
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, php4delphi, PHPCommon;
type
TForm1 = class(TForm)
psvPHP1: TpsvPHP;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
PHPEngine: TPHPEngine;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
PHPEngine.StartupEngine;
psvPHP1.Variables.Items[0].Value := Edit1.text;
psvPHP1.Variables.Items[1].Value := Edit2.text;
psvPHP1.RunCode('$z = $x + $y;');
Label3.Caption := psvPHP1.VariableByName('z').Value;
PHPEngine.ShutdownAndWaitFor;
end;
end.