How can I change soft returns to hard returns
Posted: Tue Aug 12, 2008 2:33 pm
Hello,
How can I change soft returns to hard returns ?
Sergey tells me in 2 samples how to remove returns. But I can't change his samples so that I can replace soft returns through hard returns.
procedure TForm1.RemoveWeicheReturns(RVData: TCustomRVData);
var i: Integer; //entfernt weiche Returns
rve_2: TCustomRichViewEdit;
StartNo, EndNo, a, b: Integer;
begin
rve_2 := memo.TopLevelEditor;
rve_2.GetSelectionBounds(StartNo, a, EndNo, b, True);
if StartNo<0 then begin
StartNo := rve_2.CurItemNo;
EndNo := StartNo;
end;
for i := StartNo+1 to EndNo do
if (i>0) and rve_2.IsFromNewLine(i) and (not rve_2.IsParaStart(i)) and (not rve_2.GetItem(i-1).GetBoolValue(rvbpFullWidth)) then
rve_2.GetItem(i).SameAsPrev := True;
end;
procedure TForm1.RemoveWHreturns(RVData: TCustomRVData);
var i: Integer; //entfernt weiche + harte Returns
rve_2: TCustomRichViewEdit;
StartNo, startEnd, a, b: Integer;
begin
rve_2 := memo.TopLevelEditor;
rve_2.GetSelectionBounds(StartNo, a, startEnd, b, True);
if StartNo<0 then begin
StartNo := rve_2.CurItemNo;
startEnd := StartNo;
end;
for i := startNo+1 to startEnd do
if (i>0) and RVData.IsFromNewLine(i) and (not RVData.GetItem(i).GetBoolValue(rvbpFullWidth)) and (not RVData.GetItem(i-1).GetBoolValue(rvbpFullWidth)) and ((RVData.GetItemStyle(i)<>rvsListMarker)) then RVData.GetItem(i).SameAsPrev := True
end;
How can I change soft returns to hard returns ?
Sergey tells me in 2 samples how to remove returns. But I can't change his samples so that I can replace soft returns through hard returns.
procedure TForm1.RemoveWeicheReturns(RVData: TCustomRVData);
var i: Integer; //entfernt weiche Returns
rve_2: TCustomRichViewEdit;
StartNo, EndNo, a, b: Integer;
begin
rve_2 := memo.TopLevelEditor;
rve_2.GetSelectionBounds(StartNo, a, EndNo, b, True);
if StartNo<0 then begin
StartNo := rve_2.CurItemNo;
EndNo := StartNo;
end;
for i := StartNo+1 to EndNo do
if (i>0) and rve_2.IsFromNewLine(i) and (not rve_2.IsParaStart(i)) and (not rve_2.GetItem(i-1).GetBoolValue(rvbpFullWidth)) then
rve_2.GetItem(i).SameAsPrev := True;
end;
procedure TForm1.RemoveWHreturns(RVData: TCustomRVData);
var i: Integer; //entfernt weiche + harte Returns
rve_2: TCustomRichViewEdit;
StartNo, startEnd, a, b: Integer;
begin
rve_2 := memo.TopLevelEditor;
rve_2.GetSelectionBounds(StartNo, a, startEnd, b, True);
if StartNo<0 then begin
StartNo := rve_2.CurItemNo;
startEnd := StartNo;
end;
for i := startNo+1 to startEnd do
if (i>0) and RVData.IsFromNewLine(i) and (not RVData.GetItem(i).GetBoolValue(rvbpFullWidth)) and (not RVData.GetItem(i-1).GetBoolValue(rvbpFullWidth)) and ((RVData.GetItemStyle(i)<>rvsListMarker)) then RVData.GetItem(i).SameAsPrev := True
end;