Einzelnen Beitrag anzeigen

USchuster

Registriert seit: 12. Sep 2010
Ort: L.E.
120 Beiträge
 
Delphi XE3 Professional
 
#3

AW: Array of String wird nicht als solches erkannt

  Alt 20. Aug 2011, 15:05
Folgendes Beispiel compiliert wenigsten mit Delphi 5 bis XE und die Prozedur tut es auch mit Lazarus.

Delphi-Quellcode:
program Project110;

{$APPTYPE CONSOLE}

uses
  SysUtils, Classes;

procedure StringArrayTest;
var
  I: Integer;
  SL: TStringList;
  Text: array of string;
begin
  SL := TStringList.Create;
  try
    for I := 1 to 10 do
      SL.Add(Format('Zeile %d', [I]));
    SetLength(Text, SL.Count);
    for I := 0 to SL.Count - 1 do
    begin
      Text[I] := SL[I];
      SL[I] := Text[I];
    end;
  finally
    SL.Free;
  end;
end;

begin
  StringArrayTest;
end.
Ich tippe auf Scope Probleme.
  Mit Zitat antworten Zitat