Autor Beitrag
Roadrunner116
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Mo 08.01.07 17:12 
Hallo,
kann mir Jemand sagen, wie ich den Inhalt eines Memos in ein TStringlist setzen kann?
also bei zahlen braucht man na ja IntToStr() nur wie mache ich das mit dem memo, das hat ja mehrere zeilen?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 08.01.07 17:13 
Moin!

ausblenden Delphi-Quelltext
1:
SL.Assign(Memo1.Lines);					

So. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 08.01.07 17:30 
Oder so:
ausblenden Delphi-Quelltext
1:
SL.Text := Memo1.Text					

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 08.01.07 17:33 
Moin!

user profile iconGTA-Place hat folgendes geschrieben:
Oder so:
ausblenden Delphi-Quelltext
1:
SL.Text := Memo1.Text					

Ja, das geht auch; die Assign-Variante ist aber performanter und schont den Speicher, weil nicht erst (unnötig) ein String aus den Zeilen erzeugt wird und dann wieder zerlegt werden muss. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 08.01.07 17:43 
Hallo!

Und nicht zu vergessen, es werden bei Assign die Referenzen, die in der Objects-Liste liegen, mitkopiert. Ist zwar in diesem Falle irrelevant, aber naja. ;-)

Cu,
Udontknow
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 08.01.07 18:29 
user profile iconUdontknow hat folgendes geschrieben:
Hallo!

Und nicht zu vergessen, es werden bei Assign die Referenzen, die in der Objects-Liste liegen, mitkopiert. Ist zwar in diesem Falle irrelevant, aber naja. ;-)

(Sollte nur als Bsp. dienen)

Cu,
Udontknow

Manchmal kommt es mir so vor als ob man es den Anfänger hier nicht gerade leicht machen möchte, mit Diskusionen die dem Fragesteller doch eher verwirren als sie ihm helfen.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 08.01.07 18:58 
Moin!

user profile iconBlackheart666 hat folgendes geschrieben:
Manchmal kommt es mir so vor als ob man es den Anfänger hier nicht gerade leicht machen möchte, mit Diskusionen die dem Fragesteller doch eher verwirren als sie ihm helfen.

Wo ist dein Problem?! :nixweiss: :|

Der Fragesteller hat doch nun eine Auswahl von Ansätzen, mit Begründung, warum dies oder jenes (und wohlgemerkt: Einzeiler! wo da jetzt die Komplexität zur übermäßigen Verwirrung führt... :gruebel:). Wenn´s ihn nicht weiter interessiert, kann er einen beliebigen nehmen und gut - will er "mehr" wissen, hat er genug Ansätze dafür. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 08.01.07 19:03 
So kann man es natürlich auch sehen.
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Di 09.01.07 16:35 
Bleibt ma loocker wenn ich verwirrt wäre würd ich nachfragen ....!
Dankeschön!
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Di 09.01.07 17:53 
Ich bins nochmal....

ich habe mehrere Edits und ein Memo in ein Textdokument espeichert (Funktioniert)!
Jetzt möchte ich diese Inhalte wieder in das passende Feldladen, das klappt bis auf das memo, dort wird nur eine zeile angezeigt weil ich nur "datalist[56]" abgerufen habe.
Jetz möchte ich da smit einer Schleife regeln:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
  ...

  edit50.text := datalist[50];
  edit51.text := datalist[51];
  edit52.text := datalist[52];
  edit53.text := datalist[53];
  edit54.text := datalist[54];
  edit55.Text := datalist[55];
  i := 56;
  while datalist[i] <> '' do
    begin
      i:=i+1;
      Memo_Bemerkungen.Lines.Add(datalist[i]);
    end;

Ich bekomme aber die Fehlermeldung
Zitat:
Im Projekt ist eine Exception der Klasse EStringListError aufgetreten. Meldung: 'Listenindex überschreitet das Maximum(58)'


Wa stimmt nicht?


* Edit: 'Smilies in dieser Nachricht deaktivieren'

Moderiert von user profile iconChristian S.: Quote- durch Delphi-Tags ersetzt
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Di 09.01.07 17:57 
ein fehler gefunden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  i := 56;
  while datalist[i] <> '' do
    begin
      Memo_Bemerkungen.Lines.Add(datalist[i]);
      i:=i+1;
    end;

nicht
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  i := 56;
  while datalist[i] <> '' do
    begin
      i:=i+1;
      Memo_Bemerkungen.Lines.Add(datalist[i]);
    end;


Moderiert von user profile iconChristian S.: Quote- durch Delphi-Tags ersetzt
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 09.01.07 18:04 
Moin!

Du hast deinen anderen Thread auch gelesen? ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Di 09.01.07 18:16 
doch.....
nur dne letzten post nicht :oops: tut mir leid...