Altro Scrivere su più righe TMemo (Delphi XE)

mrcamarium

Utente Bronze
7 Gennaio 2022
97
23
5
46
Sto usando Delphi XE
Sto usando un TMemo per raccogliere dei dati:
Codice:
procedure TForm1.FormCreate(Sender: TObject);
var
  ids: TidIpWatch;
  Speed: Double;
begin
 ids := TidIpWatch.Create;
 Speed := GetCPUSpeed;
 Memo1.Text := 'IP:' + (ids.LocalIP) + (Tipo_cpu);
 Memo1.Text := 'CPU: ' + (Tipo_cpu) + ' ' + Format('%f', [Speed]);
 ids.Free;
 end;
Il problema è che vorrei distribuire le informazioni su più righe, ma l'ultima copre la prima. Come si modifica il codice?
 
Avevo già usato Lines.Add ma mi data dei problemi con le informazioni contenute nelle stringhe, invece facendo cosi ho risolto:
Codice:
procedure TForm1.FormCreate(Sender: TObject);
var
  ids: TidIpWatch;
  Speed: Double;
  myStringList: TStringList;
begin
 ids := TidIpWatch.Create;
 Speed := GetCPUSpeed;
 ids.Free;
 myStringList:=TStringList.Create;
 myStringList.Add('IP:' + (ids.LocalIP));
 myStringList.Add('CPU: ' + (Tipo_cpu) + ' ' + Format('%f', [Speed]));
 myStringList.Add('This is the third line.');
 myStringList.Add('etc.');
 Memo1.Lines.Assign(myStringList);
 myStringList.Free;
 end;