Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Array of TMemo --> Memo[i].Lines gibts nicht (https://www.delphipraxis.net/9987-array-tmemo-memo%5Bi%5D-lines-gibts-nicht.html)

Nalincah 9. Okt 2003 09:39


Array of TMemo --> Memo[i].Lines gibts nicht
 
ich hab ne globale Variable deklariert:

Delphi-Quellcode:
var
  Memo := array of TStrings;
begin
  SetLength(Memo, Form2.Listbox1.Items.Count);
  Memo[i] := TStringList.Create;
end;
Leider funktioniert sowas nicht:

Delphi-Quellcode:
edit1.text := Memo[i].Lines[i];
Sowas auch nicht:

Delphi-Quellcode:
edit1.text := Memo[i][i];

Jan 9. Okt 2003 09:45

Re: Array of TMemo --> Memo[i].Lines gibts nicht
 
Hallo General2003
Das kann so auch nicht funktionieren.
Streiche:

Delphi-Quellcode:
Memo := array of TStrings;
setze:
Delphi-Quellcode:
Memo := array of TStringlist;
Gruß
Jan

Nalincah 9. Okt 2003 09:51

Re: Array of TMemo --> Memo[i].Lines gibts nicht
 
Wieso das?

Erst

Delphi-Quellcode:
var
  Memo := TStrings;
und dann

Delphi-Quellcode:
begin
  Memo := TStringList.Create;
  try
  finally
    memo.free;
  end
end;

Alexander 9. Okt 2003 09:58

Re: Array of TMemo --> Memo[i].Lines gibts nicht
 
Du weißt das du kein Array of TMEMO erzeugst, oder? :roll:

Tom 9. Okt 2003 09:58

Re: Array of TMemo --> Memo[i].Lines gibts nicht
 
Wo ist Dein Problem?
Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  memo : array of TStrings;
begin
  SetLength( Memo, 1 );
  Memo[0] := TStringList.Create;
  try
    Memo[0].Add( 'Hallo' );
    ShowMessage( Memo[0][0] );
  finally
    memo[0].free;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:54 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz