Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: nmendes on January 04, 2019, 12:57:01 am

Title: New line in Memo by code
Post by: nmendes on January 04, 2019, 12:57:01 am
I'm using LazReport for the first time and can't find a way to insert a newline to a memo by code. I'm using:

Code: Pascal  [Select][+][-]
  1.  
  2. procedure TForm_base.frReport_recibosGetValue(const ParName: String; var ParValue: Variant);
  3. begin
  4.  
  5.   if ParName = 'MEMO_TEST' then
  6.   begin
  7.     ParValue := 'Line 1' + LineEnding + 'Line 2';
  8.   end;
  9.  
  10. end;
  11.  
  12.  

but it shows as

Line 1Line 2

instead of

Line 1
Line 2

Thanks in advance!
Title: Re: New line in Memo by code
Post by: Jurassic Pork on January 04, 2019, 01:41:18 am
hello,
on Windows 10 64 bits, Lazarus 1.8.2 32 bits  all is good with this code (see Attachments) :
Code: Pascal  [Select][+][-]
  1. procedure TForm1.frReport1GetValue(const ParName: String; var ParValue: Variant
  2.   );
  3. begin
  4.       if ParName = 'ImageLink' then
  5.   begin
  6.     ParValue := 'Line 1' + LineEnding + 'Line 2';
  7.   end;
  8. end;    

Friendly, J.P
Title: Re: New line in Memo by code
Post by: nmendes on January 04, 2019, 02:11:11 am
Hi Jurassic Pork,

I'm on windows 7, Lazarus 1.8.4 32 bits and it's not working for me... I'll try 1.8.2 to see if that's the problem.

Thanks for your time trying to help me!
Title: Re: New line in Memo by code
Post by: Jurassic Pork on January 04, 2019, 02:34:28 am
my lazreport package version is the V0.9.9

and  :
Quote
const LineEnding = #13#10
M:\Dev\Lazarus\lazarus1-8-2\fpc\3.0.4\source\rtl\win32\system.pp(43,2)
TinyPortal © 2005-2018