Autor Beitrag
Thomas_1110
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Vista
Delpi 7 Personal
BeitragVerfasst: Fr 14.08.09 12:49 
Hallo Forum
Hier mal die relevanten Auszüge aus meinem Programm:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
type TPerson = Record
  VName, NName, Adresse, Email: String[80];
  Telefon, Telefon2: String[20];
  GDatum: TDate;
  Kommentar: String[255];
  DatumsEingabe: boolean;
  end;

var
  Person: array of TPerson;


procedure InsertionSort(var A: array of TPerson);
var
  i, j: Integer;
  tmp: TPerson;
begin
  for i:= 1 to high(A) do
  begin
    j:= i;
    tmp := A[i];
    while (j > 0and (A[j-1].NName > tmp.NName) do
    begin
      A[j]:= A[j-1];
      Dec(j);
    end;
    A[j]:= tmp;
  end;
end;

Möchte aber das Record Array nicht nur per NName sortieren. Gibt es keine andere Möglichkeit auf die Felder des Record zuzugreifen als mit A[index].NName?
Gruß Thomas
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 14.08.09 13:29 
Doch, gibt es:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
A[index].NName
A[index].VName
A[index].Adresse
A[index].Email
A[index].Telefon
A[index].Telefon2
Thomas_1110 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Vista
Delpi 7 Personal
BeitragVerfasst: Fr 14.08.09 14:07 
Moderiert von user profile iconNarses: Komplett-Zitat des letzten Beitrags entfernt.

Das war eigentlich das was ich umgehen wollte!
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 14.08.09 14:10 
Moin!

Dann mach es so, wie die VCL: gib eine Vergleichsfunktion mit. :idea: ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Thomas_1110 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Vista
Delpi 7 Personal
BeitragVerfasst: Fr 14.08.09 15:03 
Moderiert von user profile iconNarses: Komplett-Zitat des letzten Beitrags entfernt.

Hey, Danke. :D
So hatte ich mir das nicht vorgestellt, aber es führt zum Ziel.
Bin gerade dabei es in meinem Programm einzubauen.
Beste Grüße Thomas