Smart pascal source code
unit uMain;
interface
uses
SmartCL.System;
type
TPoint = record
X, Y: Integer;
end;
type
TTest = class
p1, p2: TPoint;
a1, a2: array [0 .. 0] of String;
procedure Test;
procedure WriteLine;
procedure Test2;
end;
implementation
procedure TTest.Test;
begin
p1.X := 1;
p1.Y := 2;
p2.X := 3;
p2.Y := 4;
a1[0] := 'a';
a2[0] := 'b';
end;
procedure TTest.Test2;
var lp1, lp2: TPoint;
la1, la2: array [0 .. 0] of String;
begin
lp1.X := 11;
lp1.Y := 12;
lp2.X := 13;
lp2.Y := 14;
la1[0] := 'la';
la2[0] := 'lb';
p1 := lp1;
p2 := lp2;
a1 := la1;
a2 := la2;
end;
procedure TTest.WriteLine;
begin
WriteLn(p1.X);
WriteLn(p1.Y);
WriteLn(p2.X);
WriteLn(p2.Y);
WriteLn(a1[0]);
WriteLn(a2[0])
end;
end.
//-----------------
{ unit1.pas }
var t := TTest.Create;
t.WriteLine;
t.Test;
t.WriteLine;
t.Test2;
t.WriteLine;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
00
00
12
34
ab
1112
1314
lalb
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}