How to add text to Memo field without incurring a carriage return
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.
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