Delphi-Quellcode:
unit Uselect;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 =
class(TForm)
Button1: TButton;
Zufallszahl: TButton;
Selectionsort: TButton;
MemoZufallszahl: TMemo;
MemoSelect: TMemo;
procedure SelectionsortClick(Sender: TObject);
procedure ZufallszahlClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
A:
array [1..20]
of integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.ZufallszahlClick(Sender: TObject);
begin
AFuellen(A,1,100);
InsMemo(A,MemoSelect);
end;
procedure TForm1.SelectionsortClick(Sender: TObject);
begin
ArraySortieren(A);
InsMemo(A,MemoSelect);
end;
procedure AFuellen(
var InsArray:
array of integer;Min, Max: integer);
var i:integer;
begin
for i:= Low(InsArray)
to High (InsArray)
do
begin
InsArray[i]:= Random(Max-Min+1)+Min;
end;
end;
procedure ArraySortieren(
var k:
array of integer);
Var
i, j : LongInt;
Temp, Min: LongInt;
Begin
For i := Low(k)
To High(k)
Do
Begin
Min := i;
For j := i+1
To High(k)
Do
If k[j] < k[Min]
Then
Min := j;
Temp := k[Min];
k[Min] := k[i];
k[i] := Temp;
End;
End;
end.
procedure InsMemo(
const insArray:
array of integer; AMemo:TMemo);
var
x:integer;
begin
AMemo.Lines.BeginUpdate;
try
AMemo.Clear;
for x:= Low(insArray)
to High (insArray)
do
begin
AMemo.Lines.Add(IntToStr(insArray[x]));
end;
finally
AMemo.Lines.EndUpdate;
end;
end;
end.
Jetzt zeigt er : uselect.pas(44,10) Error: Identifier not found "AFuellen"
uselect.pas(45,9) Error: Identifier not found "InsMemo"
uselect.pas(50,17) Error: Identifier not found "ArraySortieren"
uselect.pas(51,10) Error: Identifier not found "InsMemo"
uselect.pas(82,1) Fatal: There were 4 errors compiling module, stopping
Und was soll ich jetzt machen?