Avoid new line in frxMemoView

edited 7:42PM in FastReport VCL 5
I need help with the following problem:
My program prints a kind of diploma.
In a memoView several lines of text are printed (streched).
To keep the printed diploma from beeing changed by adding text manually, the last line has to end with '----'.
How can i avoid the case, where appending '----' to the text, results in a new line?
(which meens that the last line is already filled with text and no '----' must be added)

I tried this:

procedure MemoSperrenOnAfterData(Sender: TfrxComponent);
var count: integer;
begin
count := tFrxMemoView(sender).lines.count;
if count > 1 then
if tFrxMemoView(sender).lines.strings[count - 1] = '----' then
TfrxMemoView(Sender).Memo.Delete(count - 1);
end;

begin

end.

But it does not work. Maybe the text is not jet wrapped when OnAfterData is triggered!?



I use Delphi xe5 and fast report vcl 5.1

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:42PM
    Your problem is probably here
    "if tFrxMemoView(sender).lines.strings[count - 1] = '----' then"
    wrapping has occured, but you may not have 4 '-' characters
    depending on the length of the previous line and the width of the memo and rhe font size

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.