Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Sa 14.05.11 11:57 
Hallo,

ich stehe gerade auf der Leitung. Wie kann man wenn bei beim SpinEdit2 zb: 3 einstellt die ersten 3 Stellen beim memo rausschneiden?

SpinEdit.Value = 3
Mein Test

macht
n Test

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  for i := 0 to Memo6.Lines.Count - 1 do
   begin
     s := Memo6.Lines[i];
     for I2 := 0 to length(s) - 1 do
       begin
       If (SpinEdit2.Value < (i2 + 1)) then s2 := s2 + Memo6.Lines[i][i2];
       end;
   Memo6.Lines[i] := s2;
   end;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 14.05.11 12:37 
Wie wäre es mit Copy?
ausblenden Delphi-Quelltext
1:
2:
  for i := 0 to MyMemo.Lines.Count - 1 do
    MyMemo.Lines[i] := Copy(MyMemo.Lines[i], MySpinEdit.Value, MaxInt);
Und nebenbei:
Vergiss nicht deine Komponenten noch ordentlich zu bezeichnen. :D
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Sa 14.05.11 13:02 
Danke jaenicke.

Jetzt gehts, nur hat dein Code einen kleinen Fehler. Nach MySpinEdit muss noch + 1 dazu.

ausblenden Delphi-Quelltext
1:
2:
  for i := 0 to MyMemo.Lines.Count - 1 do
    MyMemo.Lines[i] := Copy(MyMemo.Lines[i], MySpinEdit.Value + 1, MaxInt);