Recent Posts

Pages: 1 [2] 3 4 ... 10
LazReport / Save as PDF with PowerPDF
« Last post by Nicola Gorlandi on Today at 10:20:01 am »
Hi all, I am using Lazarus 2.2.4 on Windows and I am not able to export LazReport as PDF using PowerPDF (latest version from OPM).

The library raise the exception in the procedure below. I try to use the same report using a previous version and it works fine.

Any suggestions to debug the issue ?

Many thanks

Code: Pascal  [Select][+][-]
  1. procedure TPdfCanvasAttribute.SetWordSpace(Value: Single);
  2. begin
  3.   if Value < 0 then
  4.     raise EPdfInvalidValue.Create('SetWordSpace --invalid word space');
  5.   if Value <> FWordSpace then
  6.     FWordSpace := Value;
  7. end;    
General / string.StartsWith vs. UTF8StartsText
« Last post by stoffman on Today at 10:05:56 am »
I have a TStringList populated with valid UTF-8 strings. And I need to find a string that begins with a given text. Now both functions string.StartsWith and UTF8StartsText seems to do what I want BUT UTF8StartsText is about an order of magnitude slower. As this is a hot loop I need it to work as fast as possible.

So is it safe to use string.StartsWith? (I'm not having just Latin text) and if so why UTF8StartsText even exists?


I attach a chat like demo application where connected clients can communicate with each other(only messages, no file transfer or streaming). Start server or daemon, connect a few clients then click "Remote clients" as in the attached image.

TDBLookupComboBox's AutoComplete doesn't work for me too.

Lazarus v2.2.7
FPC 3.2.2
Linux GTK2
General / Re: Incomplete CallStack in program Log
« Last post by Thaddy on Today at 09:39:00 am »
Nemanau, kad taip yra

The call stack has a defined limit (of depth 5) , but you can extend it.

Gerai? Kitu atveju susisiekite su manimi.

(My wife is Lithuanian, we are buying a house there - near Klaipėda-, so I know a little of the language )

Well it is actually just a pair of sockets. It is a bit cumbersome, but it is not really difficult for you, although it IS difficult for beginners.
In order to cover all the NAT traversal mechanism you have to do a lot of work in my opinion.
General / Re: Incomplete CallStack in program Log
« Last post by Valdas on Today at 09:21:24 am »
Yes, I am in on Linux.

I crafted a simple test project (attached), where:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   event: TNotifyEvent;
  4. begin
  5.     event := nil;
  6.     event(nil); // <-- problem
  7. end;
In the Lazarus debugger, I can see that the problem lies in "event(nil)":
#0  at :-1
#1 TForm1.Button1Click(TForm1($00007EFE14BE9910), TObject($00007EFE14BEA0F0)) at /home/senbuvis/Poligonas/t_13/Testas_13/unit1.pas:59 <---- problem
#2 TCONTROL.CLICK(TCONTROL($00007EFE14BEA0F0)) at /home/senbuvis/Git/lazarus/lcl/include/
#3 TBUTTONCONTROL.CLICK(TBUTTONCONTROL($00007EFE14BEA0F0)) at /home/senbuvis/Git/lazarus/lcl/include/
#4 TCUSTOMBUTTON.CLICK(TCUSTOMBUTTON($00007EFE14BEA0F0)) at /home/senbuvis/Git/lazarus/lcl/include/
#5 TCUSTOMBUTTON.EXECUTEDEFAULTACTION(TCUSTOMBUTTON($00007EFE14BEA0F0)) at /home/senbuvis/Git/lazarus/lcl/include/
... ...
Line index #1 from the debugger listing points to the address $46A67F in assembler window:
/home/senbuvis/Poligonas/t_13/Testas_13/unit1.pas:57  begin
000000000046A660 55                       push rbp
000000000046A661 4889E5                   mov rbp,rsp
000000000046A664 488D6424E0               lea rsp,[rsp-$20]
000000000046A669 48897DF0                 mov [rbp-$10],rdi
000000000046A66D 488975F8                 mov [rbp-$08],rsi
/home/senbuvis/Poligonas/t_13/Testas_13/unit1.pas:58  event := nil;
000000000046A671 31D2                     xor edx,edx
000000000046A673 48C745E000000000         mov qword ptr [rbp-$20],$00000000
000000000046A67B 488955E8                 mov [rbp-$18],rdx
/home/senbuvis/Poligonas/t_13/Testas_13/unit1.pas:59  event(nil); <----- problem
000000000046A67F 4889D7                   mov rdi,rdx
000000000046A682 31F6                     xor esi,esi
000000000046A684 FF55E0                   call qword ptr [rbp-$20]
/home/senbuvis/Poligonas/t_13/Testas_13/unit1.pas:60  end;
000000000046A687 4889EC                   mov rsp,rbp
000000000046A68A 5D                       pop rbp
000000000046A68B C3                       ret
000000000046A68C 0000                     add [rax],al
000000000046A68E 0000                     add [rax],al
However, the program's call stack log skips that essential (for me) address where "event(nil)" is located:
Message: Access violation
  $0000000000000000                                               (line #0 from Lazarus log)
  $000000000061F526  CLICK,  line 2968 of include/     (line #2 from Lazarus log)
  $0000000000662566  CLICK,  line 56 of include/ (line #3 from Lazarus log)
  $0000000000662E11  CLICK,  line 169 of include/      (line #4 from Lazarus log)
  .....                            .....      .....
Hmm... there address $00000000 is included.

So conclusion is: the exception call stack log is missing some lines (addresses) of my code because program's exception call stack reporting code is not powerful enough or data is modified after exception occurs?
So I copied the code from 'your button 1' and placed it into one of my buttons 'button 2'.
I get instant compile errors, attached an image.

All of the highlighted errors are defined in the ectypes.pas unit. Does that unit appear in your uses clause?
BTW, you can use for the server and clients the package Snap7. This is a very robust industrial communication system based on a industrial 'Standard' of a large PLC-Supplier and very well documented. You can have a lot of clients, and share information between mixed systems. Not only Delphi and Lazarus. This Package is available on nearly all popular systems and bitness. For the clients you can also use PascalSCADA, which works without a library and is pure pascal (but can not be a server, client only). PascalSCADA is also very robust, but i think the never versions are Lazarus/fpc only.

I know this idea is not mainstream working with sockets or something, but it is very very stable and used normal for industrial enviroments. But only a idea more for discussion..
search where eosButton, edtSimple and etsSolid is defined. Such an error is normal you only have not all needed units bound.
Pages: 1 [2] 3 4 ... 10

TinyPortal © 2005-2018