How to add text to Memo field without incurring a carriage return

edited November 2017 in FastReport 4.0
Hi,
I am trying to add a series of text strings to a memo field, however I find that every time a "carriage return" is added at the end. I have a series of conditional expressions that add interval periods to a memo field. When I view the report I expect to get something like this:

2 Months 4 Days 1 Hour 2 Minutes

Instead I get a memo field that looks like this:

2 Months
4 Days
1 Hour
2 Minutes


An example of my code is this:
// Insert number of Hours
If <frxDB1."BrdAge Hours"> = 1 then Memo2.Memo.Text := Memo2.Memo.Text + inttoStr(<frxDB1."BrdAge Hours">) + ' Hour '
else if <frxDB1."BrdAge Hours"> > 1 then Memo2.Memo.Text := Memo2.Memo.Text + inttoStr(<frxDB1."BrdAge Hours">) + ' Hours ';

This seems a real "rookie" mistake, however I can find no reference anywhere for in terms of how to avoid a carriage return being added every time I add text to the memo field text field.
Your help is appreciated, thank you.

PS. A workaround I have discovered is to create a new string variable, add in all my separate text strings into that, and finally copy the full string into the Memo Text field. I would still like to know why the memo field automatically adds a newline or carriage return every time a bit is added to the end though.

Comments

  • gpigpi
    edited 5:16PM
    Try Memo2.Memo.Text := Trim(Memo2.Memo.Text) + inttoStr(<frxDB1."BrdAge Hours">) + ' Hour '

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.