Update of /cvsroot/jvcl/dev/JVCL3/examples/RaLib/RaInterpreter/samples
In directory sc8-pr-cvs1:/tmp/cvs-serv5637/JVCL3/examples/RaLib/RaInterpreter/samples
Added Files:
AncestorForm.dfm AncestorForm.pas DescendantForm.dfm
DescendantForm.pas QRUnit_D2_B1.dfm QRUnit_D2_B1.pas
QRUnit_D3_D4_B3.dfm QRUnit_D3_D4_B3.pas TestForm.dfm
TestForm.pas TestUnit 2.pas TextDFM.dfm TextDFM.pas UUnit2.pas
UUnit3.pas Unit1.dfm Unit1.pas Unit4.dfm Unit4.pas
fModalForm.dfm fModalForm.pas file.txt sample - -1.pas
sample - TStrings 2.pas sample - TStrings write Item.pas
sample - TStrings.pas sample - array as parameter.pas
sample - array read.pas sample - array write.pas
sample - case statement (2).pas sample - case statement.pas
sample - excel-2.pas sample - excel.pas
sample - extended uses.pas sample - external function.pas
sample - form.pas
sample - global constants and variables (UUnit1).pas
sample - long loop.pas sample - makeform.pas
sample - memory leak.pas sample - program1.pas
sample - read file 1.pas sample - record read.pas
sample - record.pas sample - string char.pas
sample - string read char.pas sample - string write char.pas
sample - test1.pas
Log Message:
- Copied jvcl/devtools and jvcl/examples dev/JVCL3
- Copied JVCLConvert *.dat files to dev/JVCL3/converter
--- NEW FILE: AncestorForm.dfm ---
object Ancestor: TAncestor
Left = 192
Top = 113
Width = 436
Height = 259
Caption = 'Ancestor'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 428
Height = 232
Align = alClient
BevelInner = bvSpace
BevelOuter = bvNone
BorderWidth = 5
TabOrder = 0
object AncestorButton1: TButton
Left = 184
Top = 192
Width = 131
Height = 25
Caption = 'AncestorButton1'
TabOrder = 0
OnClick = AncestorButton1Click
end
end
end
--- NEW FILE: AncestorForm.pas ---
unit AncestorForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TAncestor = class(TForm)
Panel1: TPanel;
AncestorButton1: TButton;
procedure AncestorButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Ancestor: TAncestor;
implementation
{$R *.DFM}
procedure TAncestor.AncestorButton1Click(Sender: TObject);
begin
ShowMessage('AncestorButton clicked');
end;
end.
--- NEW FILE: DescendantForm.dfm ---
inherited Descendant: TDescendant
Left = 210
Top = 177
Caption = 'Descendant'
OldCreateOrder = True
PixelsPerInch = 96
TextHeight = 13
inherited Panel1: TPanel
object DescendantButton1: TButton
Left = 184
Top = 136
Width = 121
Height = 25
Caption = 'DescendantButton1'
TabOrder = 1
OnClick = DescendantButton1Click
end
end
end
--- NEW FILE: DescendantForm.pas ---
unit DescendantForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
AncestorForm, StdCtrls, ExtCtrls;
type
TDescendant = class(TAncestor)
DescendantButton1: TButton;
procedure DescendantButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Descendant: TDescendant;
implementation
{$R *.DFM}
procedure TDescendant.DescendantButton1Click(Sender: TObject);
begin
//inherited;
ShowMessage('DescendantButton clicked');
end;
end.
--- NEW FILE: QRUnit_D2_B1.dfm ---
object QRListForm: TQRListForm
Left = 198
Top = 136
Width = 578
Height = 212
HorzScrollBar.Range = 1200
VertScrollBar.Range = 2000
AutoScroll = False
Caption = 'QuickReport List'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
OldCreateOrder = True
Scaled = False
PixelsPerInch = 96
TextHeight = 14
object Title: TQRBand
Left = 0
Top = 0
Width = 15
Height = 37
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Frame.Width = 0
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
97.8958333333333
40)
BandType = rbTitle
object QRSysData1: TQRSysData
Left = 2
Top = 0
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
5.29166666666667
0
26.4583333333333)
Alignment = taCenter
AlignToBand = True
AutoSize = False
Color = clWhite
Data = qrsReportTitle
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -27
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
Transparent = False
FontSize = 20
end
end
object PageHeader: TQRBand
Left = 0
Top = 0
Width = 15
Height = 24
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Frame.Width = 0
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
63.5
40)
BandType = rbPageHeader
object PageNumber: TQRSysData
Left = 5
Top = 4
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
13.2291666666667
10.5833333333333
26.4583333333333)
Alignment = taRightJustify
AlignToBand = True
AutoSize = False
Color = clWhite
Data = qrsPageNumber
Text = 'Page number '
Transparent = False
FontSize = 8
end
object QRLabel1: TQRLabel
Left = 12
Top = 4
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
31.75
10.5833333333333
26.4583333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = 'Page header information goes here'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
end
object Detail: TQRBand
Left = 0
Top = 0
Width = 15
Height = 24
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Frame.Width = 0
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
63.5
40)
BandType = rbDetail
object QRDBText1: TQRDBText
Left = 208
Top = 3
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
550.333333333333
7.9375
26.4583333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataField = 'LastName'
Transparent = False
WordWrap = True
FontSize = 8
end
object QRDBText2: TQRDBText
Left = 8
Top = 3
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
21.1666666666667
7.9375
26.4583333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataField = 'FirstName'
Transparent = False
WordWrap = True
FontSize = 8
end
end
object PageFooter: TQRBand
Left = 0
Top = 0
Width = 15
Height = 24
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Frame.Width = 0
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
63.5
40)
BandType = rbPageFooter
object QRDateTime: TQRSysData
Left = 5
Top = 4
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
13.2291666666667
10.5833333333333
26.4583333333333)
Alignment = taRightJustify
AlignToBand = True
AutoSize = False
Color = clWhite
Data = qrsDateTime
Text = 'Printed at '
Transparent = False
FontSize = 8
end
object QRLabel3: TQRLabel
Left = 12
Top = 4
Width = 10
Height = 10
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
26.4583333333333
31.75
10.5833333333333
26.4583333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = 'Page footer information goes here'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
end
object Table1: TTable
Active = True
DatabaseName = 'DBDemos'
TableName = 'EMPLOYEE.DB'
Left = 56
Top = 128
end
object DataSource1: TDataSource
DataSet = Table1
Left = 96
Top = 128
end
end
--- NEW FILE: QRUnit_D2_B1.pas ---
unit QRUnit_D2_B1;
// QuickReport simple list
// - Connect a datasource to the QuickReport component
// - Put QRDBText components on the Detail band
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Quickrep, StdCtrls, ExtCtrls, DB, DBTables, Qrctrls, QuickRpt;
type
TQRListForm = class(TForm)
QuickReport1: TQuickReport;
Title: TQRBand;
PageHeader: TQRBand;
Detail: TQRBand;
PageNumber: TQRSysData;
PageFooter: TQRBand;
QRDateTime: TQRSysData;
QRSysData1: TQRSysData;
QRLabel1: TQRLabel;
QRLabel3: TQRLabel;
Table1: TTable;
DataSource1: TDataSource;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
QRListForm: TQRListForm;
implementation
{$R *.DFM}
end.
--- NEW FILE: QRUnit_D3_D4_B3.dfm ---
object Form1: TForm1
Left = 317
Top = 205
Width = 450
Height = 248
HorzScrollBar.Position = 186
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
Scaled = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = -186
Top = 0
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
BeforePrint = QuickRep1BeforePrint
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial Cyr'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
#39#39)
OnNeedData = QuickRep1NeedData
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = First
PrintIfEmpty = False
SnapToGrid = True
Units = MM
Zoom = 100
object TitleBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333
1899.70833333333)
BandType = rbTitle
object QRLabel1: TQRLabel
Left = 230
Top = 0
Width = 257
Height = 23
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
60.8541666666667
608.541666666667
0
679.979166666667)
Alignment = taCenter
AlignToBand = True
AutoSize = False
AutoStretch = False
Caption = 'Ïðîáíûé îò÷åò 1'
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
Transparent = False
WordWrap = True
FontSize = 14
end
end
object PageFooterBand1: TQRBand
Left = 38
Top = 122
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbPageFooter
object QRSysData1: TQRSysData
Left = 687
Top = 0
Width = 31
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1817.6875
0
82.0208333333333)
Alignment = taRightJustify
AlignToBand = True
AutoSize = False
Color = clWhite
Data = qrsPageNumber
Text = 'Page '
Transparent = False
FontSize = 8
end
end
object ColumnHeaderBand1: TQRBand
Left = 38
Top = 78
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbColumnHeader
object QRLabel2: TQRLabel
Left = 1
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
2.64583333333333
0
187.854166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'EmpNo'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel3: TQRLabel
Left = 82
Top = 0
Width = 141
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
216.958333333333
0
373.0625)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'LastName'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel4: TQRLabel
Left = 233
Top = 0
Width = 106
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
616.479166666667
0
280.458333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'FirstName'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
end
object DetailBand1: TQRBand
Left = 38
Top = 100
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
BeforePrint = DetailBand1BeforePrint
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbDetail
object Field1: TQRLabel
Left = 1
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
2.64583333333333
0
187.854166666667)
Alignment = taRightJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'Field1'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object Field2: TQRLabel
Left = 82
Top = 0
Width = 141
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
216.958333333333
0
373.0625)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'Field2'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object Field3: TQRLabel
Left = 233
Top = 0
Width = 106
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
616.479166666667
0
280.458333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'Field3'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRExpr1: TQRExpr
Left = 350
Top = 0
Width = 44
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
926.041666666667
0
116.416666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel5: TQRLabel
Left = 406
Top = 0
Width = 48
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1074.20833333333
0
127)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = 'QRLabel5'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
end
end
end
--- NEW FILE: QRUnit_D3_D4_B3.pas ---
unit QRUnit_D3_D4_B3;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, DBTables;
type
TForm1 = class(TForm)
QuickRep1 : TQuickRep;
TitleBand1 : TQRBand;
QRLabel1 : TQRLabel;
PageFooterBand1 : TQRBand;
QRSysData1 : TQRSysData;
ColumnHeaderBand1 : TQRBand;
DetailBand1 : TQRBand;
QRLabel2 : TQRLabel;
QRLabel3 : TQRLabel;
QRLabel4 : TQRLabel;
QRExpr1: TQRExpr;
QRLabel5: TQRLabel;
procedure FormCreate(Sender: TObject);
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
end;
var
Form1: TForm1;
implementation
//uses fJvInterpreterTest;
{$R *.DFM}
var
L, M: Integer;
DataSet: TDataSet;
procedure TForm1.FormCreate(Sender: TObject);
begin
DataSet := Application.FindComponent('Test').FindComponent('Table1');
QRLabel1.Caption := 'Demo';
L := Field2.Left;
M := 0;
Field2.Left := 100;
end;
procedure TForm1.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
var
Res: TQREvResult;
begin
Field1.Caption := DataSet.FieldValues['EmpNo'];
Field2.Caption := DataSet.FieldValues['LastName'];
Field3.Caption := DataSet.FieldValues['FirstName'];
Field2.Left := L;
L := L + 5;
{ QRExpr1.Value.strResult := 'Hello, Didier....';
QRLabel5.Caption := QRExpr1.Value.strResult; }
//Res.intResult := 111;
//QRLabel5.Caption := IntToStr(Res.intResult);
//QRExpr1.Value := Res;
//QRExpr1.Value.intResult := 1;
//QRLabel5.Caption := IntToStr(QRExpr1.Value.intResult);
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
begin
M := M + 1;
MoreData := M < 10;
DataSet.Next;
end;
procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
DataSet.Open;
DataSet.First;
end;
end.
--- NEW FILE: TestForm.dfm ---
object Form1: TForm1
Left = 184
Top = 39
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 40
Top = 64
Width = 32
Height = 13
Caption = 'Label1'
end
end
--- NEW FILE: TestForm.pas ---
unit TestForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
end.
--- NEW FILE: TestUnit 2.pas ---
unit TestUnit2;
function TestUnit2Func: string;
begin
Result := 'TestUnit2Func!!';
end;
end.
--- NEW FILE: TextDFM.dfm ---
object Form1: TForm1
Left = 150
Top = 69
Width = 220
Height = 156
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 72
Top = 48
Width = 47
Height = 13
Caption = 'Text DFM'
end
end
--- NEW FILE: TextDFM.pas ---
unit TextDFM;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
end.
--- NEW FILE: UUnit2.pas ---
unit UUnit2;
const
UConst = 'UUnit2.UConst';
var
UVar: string;
function UFunction: string;
begin
Result := 'UUnit2.UFunction';
end;
end.
--- NEW FILE: UUnit3.pas ---
unit UUnit3;
const
UConst = 'UUnit3.UConst';
var
UVar: string;
function UFunction: string;
begin
Result := 'UUnit3.UFunction';
end;
end.
--- NEW FILE: Unit1.dfm ---
object Form1: TForm1
Left = 110
Top = 120
Width = 442
Height = 381
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 8
Top = 72
Width = 72
Height = 13
Caption = 'Enter text here:'
end
object Button1: TButton
Left = 8
Top = 8
Width = 113
Height = 25
Caption = 'ShowMessage'
TabOrder = 0
OnClick = Button1Click
end
object Edit1: TEdit
Left = 8
Top = 88
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
OnChange = Edit1Change
end
object Memo1: TMemo
Left = 136
Top = 16
Width = 137
Height = 97
Lines.Strings = (
'Memo1')
TabOrder = 2
OnChange = Memo1Change
end
object ComboBox1: TComboBox
Left = 8
Top = 120
Width = 121
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 3
OnDropDown = ComboBox1DropDown
end
object GroupBox1: TGroupBox
Left = 280
Top = 8
Width = 145
Height = 105
Caption = 'Drag'#39'n'#39'Drop'
TabOrder = 4
OnDragDrop = GroupBox1DragDrop
OnDragOver = GroupBox1DragOver
OnMouseMove = GroupBox1MouseMove
object Label2: TLabel
Left = 26
Top = 48
Width = 40
Height = 13
Caption = 'Drag me'
DragMode = dmAutomatic
end
end
object Button4: TButton
Left = 136
Top = 120
Width = 185
Height = 25
Caption = 'Create button and set its OnClick'
TabOrder = 5
OnClick = Button4Click
end
object GroupBox2: TGroupBox
Left = 8
Top = 152
Width = 417
Height = 193
Caption = ' Database '
TabOrder = 6
object CheckBox2: TCheckBox
Left = 16
Top = 18
Width = 97
Height = 17
Caption = 'Open dataset'
TabOrder = 0
OnClick = CheckBox2Click
end
object Button2: TButton
Left = 14
Top = 161
Width = 75
Height = 23
Caption = 'AddRecord'
TabOrder = 1
OnClick = Button2Click
end
object DBGrid1: TDBGrid
Left = 8
Top = 43
Width = 401
Height = 110
DataSource = DataSource1
TabOrder = 2
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
end
object pnlStatus: TPanel
Left = 104
Top = 162
Width = 305
Height = 22
BevelOuter = bvLowered
Caption = 'pnlStatus'
TabOrder = 3
end
end
object RegAuto1: TJvRegAuto
RegPath = 'Software\JVCL\JvInterpreterTest'
IniFile = '$HOME/.JvInterpreterTest'
SaveWindowPlace = True
Left = 240
Top = 224
end
object Table1: TTable
AfterOpen = Table1ActiveChanged
AfterClose = Table1ActiveChanged
DatabaseName = 'DBDemos'
TableName = 'EMPLOYEE.DB'
Left = 160
Top = 216
end
object DataSource1: TDataSource
DataSet = Table1
Left = 208
Top = 240
end
end
--- NEW FILE: Unit1.pas ---
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, JvRegAuto, Grids, DBGrids, Db, DBTables;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Edit1: TEdit;
Memo1: TMemo;
ComboBox1: TComboBox;
GroupBox1: TGroupBox;
RegAuto1: TJvRegAuto;
Label2: TLabel;
Table1: TTable;
DataSource1: TDataSource;
Button4: TButton;
GroupBox2: TGroupBox;
CheckBox2: TCheckBox;
Button2: TButton;
DBGrid1: TDBGrid;
pnlStatus: TPanel;
procedure Button1Click(Sender: TObject);
procedure Memo1Change(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure GroupBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure GroupBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure GroupBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
procedure ComboBox1DropDown(Sender: TObject);
procedure Table1ActiveChanged(DataSet: TDataSet);
procedure CheckBox2Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure MyClick(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function MessageBox(hWnd: integer; lpText, lpCaption: PChar; uType: integer): Integer;
external 'user32.dll' name 'MessageBoxA';
procedure TForm1.Button1Click(Sender: TObject);
begin
MessageBox(0, 'Hello World !', 'Information', 0);
end;
procedure TForm1.Memo1Change(Sender: TObject);
begin
Label1.Caption := 'Line Count: ' + IntToStr(Memo1.Lines.Count);
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
Label1.Caption := TEdit(Sender).Text;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := Name;
end;
procedure TForm1.GroupBox1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
Label2.Caption := 'X = ' + IntToStr(X) + ', Y = ' + IntToStr(Y);
end;
procedure TForm1.GroupBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := Source = Label2;
end;
procedure TForm1.GroupBox1DragDrop(Sender, Source: TObject; X,
Y: Integer);
begin
Label2.Left := X;
Label2.Top := Y;
end;
procedure TForm1.ComboBox1DropDown(Sender: TObject);
begin
ComboBox1.Items.Add('This');
ComboBox1.Items.Add('items');
ComboBox1.Items.Add('are');
ComboBox1.Items.Add('added');
ComboBox1.Items.Add('in');
ComboBox1.Items.Add('run-time');
end;
procedure TForm1.Table1ActiveChanged(DataSet: TDataSet);
begin
if Table1.Active then
pnlStatus.Caption := 'Open'
else
pnlStatus.Caption := 'Close'
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
// if TCheckBox(Sender).Checked then
if Sender.Checked then
Table1.Open
else
Table1.Close
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Table1.AppendRecord([1000, 'Hello']);
end;
procedure TForm1.Button4Click(Sender: TObject);
var
B1: TButton;
begin
B1 := TButton.Create(Self);
B1.Parent := Self;
B1.Left := TButton(Sender).Left + TButton(Sender).Width + 20;
B1.Top := TButton(Sender).Top;
B1.Caption := 'MyButton';
B1.OnClick := MyClick;
end;
procedure TForm1.MyClick(Sender: TObject);
begin
MessageBox(0, 'MyButton Clicked', 'Information', 0);
end;
end.
--- NEW FILE: Unit4.dfm ---
object Form1: TForm1
Left = 317
Top = 205
Width = 450
Height = 248
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
Scaled = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 0
Top = 0
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
BeforePrint = QuickRep1BeforePrint
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial Cyr'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
#39#39)
OnNeedData = QuickRep1NeedData
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = First
PrintIfEmpty = False
SnapToGrid = True
Units = MM
Zoom = 100
object TitleBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333
1899.70833333333)
BandType = rbTitle
object QRLabel1: TQRLabel
Left = 230
Top = 0
Width = 257
Height = 23
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
60.8541666666667
608.541666666667
0
679.979166666667)
Alignment = taCenter
AlignToBand = True
AutoSize = False
AutoStretch = False
Caption = 'Ïðîáíûé îò÷åò 1'
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
Transparent = False
WordWrap = True
FontSize = 14
end
end
object PageFooterBand1: TQRBand
Left = 38
Top = 122
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbPageFooter
object QRSysData1: TQRSysData
Left = 687
Top = 0
Width = 31
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1817.6875
0
82.0208333333333)
Alignment = taRightJustify
AlignToBand = True
AutoSize = False
Color = clWhite
Data = qrsPageNumber
Text = 'Page '
Transparent = False
FontSize = 8
end
end
object ColumnHeaderBand1: TQRBand
Left = 38
Top = 78
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbColumnHeader
object QRLabel2: TQRLabel
Left = 1
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
2.64583333333333
0
187.854166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'EmpNo'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel3: TQRLabel
Left = 82
Top = 0
Width = 141
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
216.958333333333
0
373.0625)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'LastName'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel4: TQRLabel
Left = 233
Top = 0
Width = 106
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
616.479166666667
0
280.458333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'FirstName'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel5: TQRLabel
Left = 349
Top = 0
Width = 29
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
923.395833333333
0
76.7291666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'PhoneExt'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel6: TQRLabel
Left = 388
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1026.58333333333
0
187.854166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'HireDate'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
object QRLabel7: TQRLabel
Left = 469
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1240.89583333333
0
187.854166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption = 'Salary'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 8
end
end
object DetailBand1: TQRBand
Left = 38
Top = 100
Width = 718
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
BeforePrint = DetailBand1BeforePrint
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
58.2083333333333
1899.70833333333)
BandType = rbDetail
object QRExpr1: TQRExpr
Left = 1
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
2.64583333333333
0
187.854166666667)
Alignment = taRightJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[EmpNo]'
FontSize = 8
end
object QRExpr2: TQRExpr
Left = 82
Top = 0
Width = 141
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
216.958333333333
0
373.0625)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[LastName]'
FontSize = 8
end
object QRExpr3: TQRExpr
Left = 233
Top = 0
Width = 106
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
616.479166666667
0
280.458333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[FirstName]'
FontSize = 8
end
object QRExpr4: TQRExpr
Left = 349
Top = 0
Width = 29
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
923.395833333333
0
76.7291666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[PhoneExt]'
FontSize = 8
end
object QRExpr5: TQRExpr
Left = 388
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1026.58333333333
0
187.854166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[HireDate]'
FontSize = 8
end
object QRExpr6: TQRExpr
Left = 469
Top = 0
Width = 71
Height = 15
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
39.6875
1240.89583333333
0
187.854166666667)
Alignment = taRightJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Color = clWhite
ResetAfterPrint = False
Transparent = False
WordWrap = True
Expression = '[Salary]'
FontSize = 8
end
end
end
end
--- NEW FILE: Unit4.pas ---
unit Unit2;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, DBTables;
type
TForm1 = class(TForm)
QuickRep1 : TQuickRep;
TitleBand1 : TQRBand;
QRLabel1 : TQRLabel;
PageFooterBand1 : TQRBand;
QRSysData1 : TQRSysData;
ColumnHeaderBand1 : TQRBand;
DetailBand1 : TQRBand;
QRLabel2 : TQRLabel;
QRExpr1 : TQRExpr;
QRLabel3 : TQRLabel;
QRExpr2 : TQRExpr;
QRLabel4 : TQRLabel;
QRExpr3 : TQRExpr;
QRLabel5 : TQRLabel;
QRExpr4 : TQRExpr;
QRLabel6 : TQRLabel;
QRExpr5 : TQRExpr;
QRLabel7 : TQRLabel;
QRExpr6 : TQRExpr;
procedure FormCreate(Sender: TObject);
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRep1BeforePrint(Sender: TQuickRep;
var PrintReport: Boolean);
private
DataSet: TDataSet;
public
L, M: Integer;
end;
var
Form1: TForm1;
implementation
//uses fJvInterpreterTest;
{$R *.DFM}
function MessageBox(hWnd: integer; lpText, lpCaption: PChar; uType: integer): Integer;
external 'user32.dll' name 'MessageBoxA';
procedure TForm1.FormCreate(Sender: TObject);
begin
// QuickRep1.DataSet.Active := True;
// QRLabel1.Enabled := False;
DataSet := Application.FindComponent('Test').FindComponent('Table1');
// MessageBox(0, DataSet.Name, 'Information', 0);
QRLabel1.Caption := 'Greetings'; // [translated]
L := QRExpr2.Left;
M := 0;
end;
procedure TForm1.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
QRExpr2.Left := L;
QRExpr1.Expression := DataSet.FieldValues['EmpNo'];
QRExpr2.Expression := DataSet.FieldValues['LastName'];
QRExpr3.Expression := DataSet.FieldValues['FirstName'];
L := L + 1;
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
begin
M := M + 1;
MoreData := M < 10;
// MoreData := True;
DataSet.Next;
end;
procedure TForm1.QuickRep1BeforePrint(Sender: TQuickRep;
var PrintReport: Boolean);
begin
DataSet.Open;
DataSet.First;
end;
end.
--- NEW FILE: fModalForm.dfm ---
object MyModalForm: TMyModalForm
Left = 200
Top = 137
Width = 259
Height = 164
Caption = 'Modal Form'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Visible = True
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 32
Top = 80
Width = 75
Height = 25
Caption = 'Ok'
ModalResult = 1
TabOrder = 0
end
object Button2: TButton
Left = 144
Top = 80
Width = 75
Height = 25
Caption = 'Cancel'
ModalResult = 2
TabOrder = 1
end
object Hello: TButton
Left = 88
Top = 24
Width = 75
Height = 25
Caption = 'Hello'
TabOrder = 2
OnClick = HelloClick
end
end
--- NEW FILE: fModalForm.pas ---
unit fModalForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TMyModalForm = class(TForm)
Button2: TButton;
Button1: TButton;
Hello: TButton;
procedure HelloClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MyModalForm: TMyModalForm;
implementation
{$R *.DFM}
procedure TMyModalForm.HelloClick(Sender: TObject);
begin
ShowMessage('Click');
end;
end.
--- NEW FILE: file.txt ---
Hello, World !
--- NEW FILE: sample - -1.pas ---
unit a;
function main;
var
pDlg: TForm;
pControl: TControl;
pPoint: TPoint;
begin
pDlg := TForm.Create(nil);
try
pControl := TControl.Create(pDlg);
try
pControl.Parent := pDlg;
pPoint.x := 0;
pPoint.y := 0;
pControl.ClientToScreen(pPoint);
finally
pControl.Free;
end;
finally
pDlg.Free;
end;
end;
end.
--- NEW FILE: sample - TStrings 2.pas ---
unit U;
function main: string;
var
SS: TStringList;
begin
SS := TStringList.Create;
SS.Add('Line 0');
Result := SS[0];
SS.Free;
end;
end.
--- NEW FILE: sample - TStrings write Item.pas ---
var
SS: TStringList;
S: string;
begin
SS := TStringList.Create;
//SS.Add('Line 0');
//SS.Add('Line 1');
SS.Text := 'Line 0 ' + #13 + 'Line 1';
// [translated]:
//SS.Strings[0] := 'Greetings';
// [translated]:
SS.Strings[0] := 'Greetings';
S := SS[1];
Result := '! ' + S[2] + ' !';
SS.Free;
end;
--- NEW FILE: sample - TStrings.pas ---
var
SS: TStringList;
begin
SS := TStringList.Create;
SS.Add('Line 0');
SS.Add('Line 1');
Result := '! ' + SS[1] + ' !';
SS.Free;
end;
--- NEW FILE: sample - array as parameter.pas ---
// This script not working !
// Arrays as parameters not supported now....
// Sorry....
unit cray;
function main: string;
var
A: array[1..10] of integer;
begin
InitArray(A);
//Result := A[4];
end;
procedure InitArray(var A: _array);
begin
//A[4] := '!';
end;
end.
--- NEW FILE: sample - array read.pas ---
var
A: array[1..10] of integer;
begin
Result := A[10];
end;
--- NEW FILE: sample - array write.pas ---
var
A: array[1..1000] of integer;
i: Integer;
begin
for i := 1 to 1000 do
A[i] := i;
Result := 1;
for i := 1 to 1000 do
Result := Result + A[i];
end;
--- NEW FILE: sample - case statement (2).pas ---
unit Unit1;
const
V = 1;
function caseme(Param: integer): string;
begin
case Param of
V:
Result := '1 selected';
1 + 1:
Result := '2 selected';
else
Result := '"else" selected';
end;
end;
function main: string;
begin
Result := caseme(1);
end;
end.
--- NEW FILE: sample - case statement.pas ---
var
C: Integer;
begin
Result := 0;
C := 2;
case C of
1:
begin
Result := 1;
end;
1 + 1:
Result := 2;
else
Result := 9;
end;
Result := Result + 100;
end;
--- NEW FILE: sample - excel-2.pas ---
var
Excel : Variant;
Workbook : Variant;
Worksheet : Variant;
Cells : Variant;
Item : Variant;
X, Y : Integer;
begin
Excel := CreateOleObject('Excel.Application');
try
// Make a new workbook in Excel
Workbook := Excel.Workbooks.Add;
// Create a new worksheet
Worksheet := Workbook.Worksheets.Add;
Worksheet.Activate;
// Fill in some cells with "Hello!"
Item := Worksheet.Range('A1:B8');
Item.Value := 'Hello!';
// Fill in a cell with "Goodbye"
Cells := Excel.Cells;
Item := Cells.Item(2,1);
Item.Value := 'Goodbye';
// Save the workbook
Workbook.SaveAs('C:\Temp\Test.xls');
finally
// Always make sure to tell Excel to quit
// or it will stay in memory
Excel.Quit;
end;
end;
--- NEW FILE: sample - excel.pas ---
Var ExcelWindow, NewWorkBooks, WorkBook, Cell, Range, Border, WorkSheet,
Diagram, MyDiagram : Variant;
Line, Column, LineCount, ColumnCount : Integer;
begin
ExcelWindow := CreateOleObject('Excel.Application');
// Let's make the Excel window visible and active [translated]
ExcelWindow.Visible := 1;
// We set a name of the Excel window [translated]
// [translated]:
ExcelWindow.Caption := 'Report';
// Let us create the new working book [translated]
NewWorkBooks := ExcelWindow.Workbooks;
WorkBook := NewWorkBooks.Add;
LineCount := 10;
ColumnCount := 5;
// Let's put down names of lines [translated]
For Line := 1 to LineCount do
begin
Cell := ExcelWindow.Cells(Line + 1, 1);
// [translated]:
Cell.Value := 'Line ' + Line;
end;
// Let's put down names of columns [translated]
for column := 1 to ColumnCount do
begin
Cell := ExcelWindow.Cells(1, Column + 1);
// [translated]:
Cell.Value := 'Column ' + Column;
end;
// let us fill the cells of table with values [translated]
for Line := 1 to LineCount do
for Column := 1 to ColumnCount do
begin
Cell := ExcelWindow.Cells(Line + 1, Column + 1);
Cell.Value := Line + Column;
end;
// Isolate range in the table and set to its variable of the language [translated]
Range := ExcelWindow.Range(ExcelWindow.Cells(1, 1),
ExcelWindow.Cells(LineCount + 1, ColumnCount + 1));
// let us assign the name of the chosen region [translated]
// [translated]:
Range.Name := 'Oblast Dannyh';
// Let's define a framework of the selected area and we shall assign its variable of the language [translated]
Border := Range.Borders;
// Let's set styles for a framework of the selected area [translated]
Border.LineStyle := 1;
Border.ColorIndex := 3;
// Let's construct the diagram [translated]
WorkSheet := WorkBook.Worksheets(1);
Diagram := WorkSheet.ChartObjects;
Diagram := Diagram.Add(5, 5 + Range.Top + Range.Height,
Range.Width, Range.Height);
MyDiagram := Diagram.Chart;
// [translated]:
MyDiagram.ChartWizard('Oblast Dannyh ', -4102, 6, 1, 1, 1, 1, 'Report');
end;
--- NEW FILE: sample - extended uses.pas ---
unit TestUnit1;
uses 'TestUnit 2';
function main: string;
begin
Result := TestUnit2Func;
end;
end.
--- NEW FILE: sample - external function.pas ---
unit UserName;
function main: string;
var
S: string;
Sz: Integer;
begin
S := '';
Sz := 255;
SetLength(S, Sz);
if not GetUserName(S, Sz) then
RaiseLastWin32Error;
SetLength(S, Sz);
Result := S;
end;
function GetUserName(lpBuffer: PChar; var nSize: DWORD): BOOL;
external 'advapi32.dll' name 'GetUserNameA';
end.
--- NEW FILE: sample - form.pas ---
unit SampleForm;
interface
// interface's uses clause is ignored
// by OnGetUnitSource event
uses Windows, Messages, Forms;
implementation
uses fModalForm;
function main: string;
var
Form: TForm;
begin
Form := TMyModalForm.Create(nil);
Form.ShowModal;
Form.Free;
end;
end.
--- NEW FILE: sample - global constants and variables (UUnit1).pas ---
unit UUnit1;
uses UUnit2, UUnit3;
{const
UConst = 'UUnit1.UConst';}
var
UVar: TStringList;
function main: string;
begin
//Result := UConst;
//Result := UUnit2.UConst;
Result := UUnit2.UFunction;
end;
end.
--- NEW FILE: sample - long loop.pas ---
unit U;
function main: Integer;
var
I: integer;
begin
Result := 0;
for i := 1 to 1000 do
Result := square(i);
end;
function square(P: Integer): Integer;
begin
Result := P * P;
end;
end.
--- NEW FILE: sample - makeform.pas ---
var
MyForm: TForm;
begin
MyForm := JvInterpreterMakeForm(ExePath + 'samples\fModalForm.pas');
if MyForm.ShowModal = mrOk then
showmessage('OK button clicked');
MyForm.Free;
end;
--- NEW FILE: sample - memory leak.pas ---
unit Unit1;
procedure main;
var
i: Integer;
begin
for i := 1 to 100000 do
begin
func(i);
end;
end;
procedure func(i: Integer);
var
v1: Integer;
v2: Integer;
v3: Integer;
v4: Integer;
begin
v1 := i + 1;
v2 := i + 2;
v3 := i + 3;
v4 := i + 4;
end;
end.
--- NEW FILE: sample - program1.pas ---
program project1;
uses
UUnit2 in 'UUnit2.pas',
UUnit3 in 'UUnit3.pas';
begin
UFunction;
//S := S + '!';
end.
--- NEW FILE: sample - read file 1.pas ---
unit u1;
function main: String;
var
Fl: Integer;
St: string;
I: Integer;
Tmp: Integer;
begin
Fl := FileOpen('.\samples\file.txt', fmOpenRead);
try
St := '';
Tmp := 0;
for i := 1 to 14 do
begin
FileRead(Fl, Tmp, 1);
St := St + Chr(Tmp);
end;
ShowMessage(St);
finally
FileClose(Fl);
end;
end;
end.
--- NEW FILE: sample - record read.pas ---
var
F : TSearchRec;
begin
Result := F.Attr;
end;
--- NEW FILE: sample - record.pas ---
unit a;
procedure main;
var
pDlg: TForm;
pControl: TControl;
pPoint: TPoint;
begin
pDlg := TForm.Create(nil);
try
pControl := TControl.Create(pDlg);
pControl.Parent := pDlg;
pPoint.x := 0;
pPoint.y := 0;
pControl.ClientToScreen(pPoint);
pDlg.ShowModal;
finally
pDlg.Free;
end;
end;
end.
--- NEW FILE: sample - string char.pas ---
var
S: string;
begin
//S := '1234567890';
S := '';
try
Result := S[11];
except
on E: ERangeError do
Result := 'error';
end;
end;
--- NEW FILE: sample - string read char.pas ---
var
S: string;
begin
//[translated]:
Result := 'Greetings' + #13;
end;
--- NEW FILE: sample - string write char.pas ---
var
S: string;
begin
S := '1234567890';
S[4] := '!';
Result := S;
end;
--- NEW FILE: sample - test1.pas ---
var
B : TControl;
P: TPoint;
begin
P := Point(0, 0);
B := Application.FindComponent('Test').ClientToScreen(P);
Result := B.X;
end;
|