Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
var
MyArray: array[1..5] of real;
begin
MyArray[1] := 4.35;
end;

View file

@ -0,0 +1,6 @@
var
MyArray: array of integer;
begin
setlength (MyArray, 10);
MyArray[4] := 99;
end;

View file

@ -0,0 +1,11 @@
var
MyRecord: record
x, y, z: real;
presence: boolean;
end;
begin
MyRecord.x := 0.3;
MyRecord.y := 3.2;
MyRecord.z := -4.0;
MyRecord.presence := true;
end;

View file

@ -0,0 +1,9 @@
type
days = (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
var
workDays, week, weekendDays: set of days;
begin
workdays := [Mon, Tue, Wed, Thu, Fri];
week := workdays + [Sat, Sun];
weekendDays := week - workdays;
end;

View file

@ -0,0 +1,5 @@
var
MyString: String;
begin
MyString:= 'Some Text';
end;

View file

@ -0,0 +1,19 @@
program ListDemo;
uses
classes;
var
MyList: TList;
a, b, c: integer;
i: integer;
begin
a := 1;
b := 2;
c := 3;
MyList := TList.Create;
MyList.Add(@a);
MyList.Add(@c);
MyList.Insert(1, @b);
for i := MyList.IndexOf(MyList.First) to MyList.IndexOf(MyList.Last) do
writeln (integer(MyList.Items[i]^));
MyList.Destroy;
end.

View file

@ -0,0 +1,34 @@
Program ex34;
{ Program to demonstrate the TCollection.AtInsert method }
Uses Objects, MyObject; { For TMyObject definition and registration }
Var C : PCollection;
M : PMyObject;
I : Longint;
Procedure PrintField (Dummy : Pointer; P : PMyObject);
begin
Writeln ('Field : ',P^.GetField);
end;
begin
Randomize;
C:=New(PCollection, Init(120, 10));
Writeln ('Inserting 100 records at random places.');
For I:=1 to 100 do
begin
M:=New(PMyObject, Init);
M^.SetField(I-1);
If I=1 then
C^.Insert(M)
else
With C^ do
AtInsert(Random(Count), M);
end;
Writeln ('Values : ');
C^.Foreach(@PrintField);
Dispose(C, Done);
end.