Autor Beitrag
huuuuuh
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Sa 12.04.08 06:52 
hab ein problem mit einem array
ein string hat sieben teile, jeweils durch komma getrennt
jeder teil soll in den array gespeichert werden
der array hat 7 teile
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
repeat
inc(piecenumber);
actline:=memo1.Lines.Strings[linenumber]; //muss vor die schleife
info[piecenumber]:=split(actline,',');
memo5.Lines.Add(info[piecenumber]);
until piecenumber=7 ;

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Function Split (var S : String; Del : String) : String;
Var
  p : Integer;

Begin
  p := pos(Del,S);
  if p=0 then Begin
    Result := s;
    s := '';
    end
  else begin
    Result := Copy(s,1,p-1);
    s:=Copy (s,p+length(Del),length (s));
    End;
End;

aber das funktioniert nich
für jeden teil der info wird der erste teil des strings genommen
kann mr wer helfen?


Zuletzt bearbeitet von huuuuuh am Sa 12.04.08 11:23, insgesamt 1-mal bearbeitet
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Sa 12.04.08 07:36 
fehler schon gefunden ;)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 12.04.08 11:15 
Dann sag bitte, wo der Fehler liegt, falls jemand auf diesen Thread stößt mit einem ähnlichen Problem. Danke! :-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Sa 12.04.08 11:21 
ok ;) die zeile actline:=memo1.Lines.Strings[linenumber]; darf nicht in der schleife stehen
ich markiers im anfangs post