74 lines
2.4 KiB
HTML
74 lines
2.4 KiB
HTML
<html>
|
|
<head>
|
|
<link rel=stylesheet type="text/css" href="styles.css">
|
|
</head>
|
|
<body>
|
|
<H2>
|
|
paxCompiler for Delphi. "Hello" application.
|
|
</H2>
|
|
<hr>
|
|
|
|
<blockquote>
|
|
<pre>
|
|
<font color="blue"><b>unit</b></font> Unit1;
|
|
|
|
<font color="blue"><b>interface</b></font>
|
|
|
|
<font color="blue"><b>uses</b></font>
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
|
Dialogs, StdCtrls, PaxCompiler, PaxProgram;
|
|
<font color="blue"><b>type</b></font>
|
|
TForm1 = <font color="blue"><b>class</b></font>(TForm)
|
|
PaxCompiler1: TPaxCompiler;
|
|
PaxPascalLanguage1: TPaxPascalLanguage;
|
|
PaxProgram1: TPaxProgram;
|
|
Button1: TButton;
|
|
<font color="blue"><b>procedure</b></font> Button1Click(Sender: TObject);
|
|
<font color="blue"><b>private</b></font>
|
|
{ Private declarations }
|
|
<font color="blue"><b>public</b></font>
|
|
{ Public declarations }
|
|
<font color="blue"><b>end</b></font>;
|
|
|
|
<font color="blue"><b>var</b></font>
|
|
Form1: TForm1;
|
|
|
|
<font color="blue"><b>implementation</b></font>
|
|
|
|
{$R *.dfm}
|
|
|
|
<font color="blue"><b>procedure</b></font> TForm1.Button1Click(Sender: TObject);
|
|
<font color="blue"><b>var</b></font>
|
|
I, H_TButton: Integer;
|
|
<font color="blue"><b>begin</b></font>
|
|
PaxCompiler1.Reset;
|
|
PaxCompiler1.RegisterLanguage(PaxPascalLanguage1);
|
|
|
|
H_TButton := PaxCompiler1.RegisterClassType(0, TButton);
|
|
PaxCompiler1.RegisterVariable(0, <font color="Red">'Button1'</font>, H_TButton, @Button1);
|
|
|
|
PaxCompiler1.AddModule(<font color="Red">'1'</font>, PaxPascalLanguage1.LanguageName);
|
|
PaxCompiler1.AddCode(<font color="Red">'1'</font>, <font color="Red">'begin'</font>);
|
|
PaxCompiler1.AddCode(<font color="Red">'1'</font>, <font color="Red">' Button1.Caption := '</font><font color="Red">'Hello'</font><font color="Red">';'</font>);
|
|
PaxCompiler1.AddCode(<font color="Red">'1'</font>, <font color="Red">'end.'</font>);
|
|
|
|
<font color="blue"><b>if</b></font> PaxCompiler1.Compile(PaxProgram1) <font color="blue"><b>then</b></font>
|
|
PaxProgram1.Run
|
|
<font color="blue"><b>else</b></font>
|
|
<font color="blue"><b>for</b></font> I:=0 <font color="blue"><b>to</b></font> PaxCompiler1.ErrorCount - 1 <font color="blue"><b>do</b></font>
|
|
ShowMessage(PaxCompiler1.ErrorMessage[I]);
|
|
<font color="blue"><b>end</b></font>;
|
|
|
|
<font color="blue"><b>end</b></font>.
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<p>
|
|
<HR>
|
|
<font size = 1 color ="gray">
|
|
Copyright © 2006-2009
|
|
VIRT Laboratory. All rights reserved.
|
|
</font>
|
|
</body>
|
|
</html>
|