unit
gel6;
interface
uses
Winapi
.
Windows, Winapi
.
Messages, System
.
SysUtils, System
.
Variants, System
.
Classes, Vcl
.
Graphics,
Vcl
.
Controls, Vcl
.
Forms, Vcl
.
Dialogs, Vcl
.
StdCtrls, Vcl
.
Buttons;
type
TForm1 =
class
(TForm)
BitBtn1: TBitBtn;
Memo1: TMemo;
Memo2: TMemo;
Edit1: TEdit;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label1: TLabel;
Label2: TLabel;
procedure
BitBtn1Click(Sender: TObject);
private
public
end
;
type
slovo=
packed
array
[
1..10
]
of
char
;
TPlink = ^link;
link =
record
te : slovo;
next : TPlink;
end
;
var
Form1: TForm1;
head, Endlist, NextList: TPlink;
implementation
{$R *.dfm}
procedure
TForm1
.
BitBtn1Click(Sender: TObject);
var
n:
integer
;
Temp, NextList: TPlink;
begin
n:=
0
;
new(NextList);
NextList^.te :=Edit1
.
Text;
n:=n+
1
;
NextList^.next:=head;
head :=NextList;
Edit1
.
text :=
''
;
if
n <>
0
then
ShowMessage(
'Список:'
+ NextList^.te)
else
ShowMessage(
'В списке нет элементов.'
);
end
;
end
.