Recent

Author Topic: New line in Memo by code  (Read 4955 times)

nmendes

  • Newbie
  • Posts: 2
New line in Memo by code
« 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!

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New line in Memo by code
« Reply #1 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
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

nmendes

  • Newbie
  • Posts: 2
Re: New line in Memo by code
« Reply #2 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!

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New line in Memo by code
« Reply #3 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)
« Last Edit: January 04, 2019, 02:46:45 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018