Thema: Delphi Problem bei TStringList

Einzelnen Beitrag anzeigen

Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#16

AW: Problem bei TStringList

  Alt 11. Jun 2014, 23:12
Viel zu kompliziert...

Vorausgesetzt ich habe richtig interpretiert, was der Code des OP machen soll:
Delphi-Quellcode:
procedure PrintOutAuto;
var
  Labels: array[0..4] of TLabel;
  StringRoh: String;
  Zeit: String;
  Info: String;
  i: integer;
begin
  Labels[0] := Form1.Show1;
  Labels[1] := Form1.Show2;
  Labels[2] := Form1.Show3;
  Labels[3] := Form1.Show4;
  Labels[4] := Form1.Show5;
  
  // Standardmäßig alle Labels ausblenden
  for i := low(Labels) to high(Labels) do
    Labels[i].Visible := False;
  
  for i := 0 to slA.Count-1 do
  begin
    ShowMessage(Format('Z%d,slA[%d]', [i+1, i]));

    StringRoh := slA[i];
    Zeit := Copy(StringRoh, 1, 5);
    Info := StringRoh;
    if Length(StringRoh) > 6 then
      Delete(Info,1,6);

    Labels[i].Caption := (Zeit + ' - ' + Info);
    // Bedarfsweise Labels wieder einblenden
    Labels[i].Visible := True;
  end;
end;

Geändert von Namenloser (11. Jun 2014 um 23:18 Uhr)
  Mit Zitat antworten Zitat