Autor Beitrag
Borlox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 191

Win XP
Delphi 6 Enterprise
BeitragVerfasst: Mo 26.07.04 19:56 
Hi Leute,

ich habe drei Arrays die ArrayA,ArrayB und ArrayC heißen! Nun muss ich mit diesen alle gleiche Berechnungen durchführen! Gibt es ne Möglichkeit, dass ich für z.B. eine for i Schleife erst das erste Array benutze, dann das zweite etc. ????


Vielen Dank
Borlox


Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am Di 10.08.2004 um 16:03
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mo 26.07.04 20:02 
Hallo,
sind die Array alle gleich aufgebaut?Wenn ja, dann kansst du es so machen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
type
  Tarray=array[1..10] of integer;  <<<<<---- 
...
  var bzw. private abschnitt der form
  arrayA,ArrayB,arrayC:Tarray;

...
procedure machwas(myArray:Tarray);
  begin
    ...
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  machwas(arrayA);
  machwas(arrayB);
  machwas(arrayC);
end;


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Borlox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 191

Win XP
Delphi 6 Enterprise
BeitragVerfasst: Mo 26.07.04 20:20 
Titel: Array
Leider nicht, es sind drei dynamische Arrays, die jeweils mit einem Record verknüpft sind! Die Records sind aber gleich!
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mo 26.07.04 20:22 
dann schreibst du haltr nur
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure machwas(myArray:array of integer);  
  begin  
    ...  
  end;

ansonsten poste mehr code von deinem array und record, das man sich was vorstellen kann.

mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
MathiasH
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 699

WinXP, Win98SE, Debian, Win95
D5 Stand, D6 Prof
BeitragVerfasst: Mo 26.07.04 20:52 
wie wärs damit:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
array [1..3] of array of irgendeinrecord;


for k := 1 to 3 do
   for i := 0 to maxI do 
     ....


ist halt dann ein 2D array, aber die sind eigentlich noch recht überschaubar, harig wird ab 4D aufwärts :)

MathiasH

_________________
"Viel von sich reden, kann auch ein Mittel sein, sich zu verbergen."
Friedrich Nietzsche