Hi
ich bin neu hier und habe gleich ein Anliegen d.h. Problem.
Ich habe mir ein Algorythmus gebastelt, der je nach Text-Align eine Anzahl von Leerzeichen am Anfang jeder Zeile eines Strings, der jeweils die Zeilen eines RichEdit-Feldes einverleibt bekommt (die zeilen sind duch #13 getrennt).
Nun ergibt sich allerdings das Problem, dass ich die Leerzeichenanzahl 0 nciht verwenden kann, da sonst das Programm abschmiert. Mit einem um 1 erhöhten Wert passiert das nicht mehr, allerdings habe ich jetzt zu beginn jeder Zeile ein Leerzeichen liegen, dass ich wegbekommen will.
Nur wie bekomme ich das hin?
Schonmal dank im vorraus,
Knumonmaster
Anhang: Code - damit ihr mal ein Blick drauf werfen könnt
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52:
| procedure TForm1.SpeedButton19Click(Sender: TObject); var a,b,c,d: integer; a1,b1,c1,d1: string; i: string; begin Form3.Show; Form1.Enabled := False; a := length(RichEdit1.Lines[0]); b := length(Richedit1.Lines[1]); c := length(Richedit1.Lines[2]); d := length(Richedit1.Lines[3]); if RadioGroup1.ItemIndex=0 then begin a := 1; b := 1; c := 1; d := 1 end; if RadioGroup1.ItemIndex=1 then begin a := StrtoInt(all1.Text)-a+2; a:= a div 2; b := StrtoInt(all1.Text)-b+2; b:= b div 2; c := StrtoInt(all1.Text)-c+2; c:= c div 2; d := StrtoInt(all1.Text)-d+2; d:= d div 2 end; if RadioGroup1.ItemIndex=2 then begin a := StrtoInt(all1.Text)-a+1; b := StrtoInt(all1.Text)-b+1; c := StrtoInt(all1.Text)-c+1; d := StrtoInt(all1.Text)-d+1 end; repeat i := a1; a1 := i+' '; a := a-1; until a<=1; repeat i := b1; b1 := i+' '; b := b-1; until b<=1; repeat i := c1; c1 := i+' '; c := c-1; until c<=1; repeat i := d1; d1 := i+' '; d := d-1; until d<=1; Form3.Label2.Caption := a1 + Richedit1.lines[0] + #13 + b1 + Richedit1.lines[1] + #13 + c1 + Richedit1.Lines[2] + #13 + d1 + Richedit1.Lines[3]; end; |