Autor Beitrag
bis11 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Do 01.05.03 14:47 
Sorry, war ein schreibfehler von mir mit prnconfig, ich meinte natürlich prntext. Ich benutze aber kein Memo. Ich benutze das Array wie ein Datenbankabfrage mit while not eof do begin. Ich habe nun mein Problem durch folgende Funktion gelöst, die ich auch haben wollte :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure DeleteArrayIndex(var X: ArrOfStr; Index: Integer);
begin
  if Index > High(X) then Exit;
  if Index < Low(X) then Exit;
  if Index = High(X) then
  begin
    SetLength(X, Length(X) - 1);
    Exit;
  end;
  Finalize(X[Index]);
  System.Move(X[Index +1], X[Index],
  (Length(X) - Index -1) * SizeOf(string) + 1);
  SetLength(X, Length(X) - 1);
end;


Und aufrufen tue ich die Procedure so, am Ende der FOR-Schleife :
ausblenden Quelltext
1:
2:
      for i:= 7 downto 0 do
        DeleteArrayIndex(prntext,i);
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Do 01.05.03 14:55 
Ich sag dazu nur folgendes:
ausblenden Quelltext
1:
SetLength(prntext, 0);					

macht genau das gleiche nur nicht so langsam und umständlich.

_________________
Ist Zeit wirklich Geld?
bis11 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Do 01.05.03 15:06 
Dann probiere doch mal folgendes :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
var 
  i: Integer; 
  prnconfig: TStrings; 
  prntext : ArrOfStr; 
begin 
  prnConfig := TStringList.Create; 
  prnConfig.Add('Wert1;Wert2;Wert3;Wert4'); 
  prnConfig.Add('AAAA1;AAAA2;AAAA3;AAAA4'); 

  for i := 0 to prnconfig.Count - 1 do 
  begin 
    prntext := Explode(';', prnconfig[i]); 
    Label1.Caption := prntext[0];
    Label2.Caption := prntext[1];
    Label3.Caption := prntext[2];
    Label4.Caption := prntext[3];
    SetLength(prntext,0);
  end;
  prnConfig.Free; 
end;


Das mir dieses Beispiel nicht schon früher eingefallen ist. :D Wenn ich das ablaufen lasse, habe ich immer die Werte der erste Reihe in den Labels stehen
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Do 01.05.03 16:03 
bis11 hat folgendes geschrieben:
Dann probiere doch mal folgendes

Mach ich gerne.


Zitat:
Wenn ich das ablaufen lasse, habe ich immer die Werte der erste Reihe in den Labels stehen

Ich habe die Werte der letzten Reihe in den Labels, da diese eben als letzte ausgeführt wird.

_________________
Ist Zeit wirklich Geld?
bis11 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Do 01.05.03 19:16 
Dann verstehe ich die Welt nichtmehr. Aber trotzdem Danke für Deine Hilfe.