Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-04

TDBNavigator.OnClick has problem

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

Hello,

if I use "OnClick" event, example

procedure TFRM_.NAV_Click(Sender: TObject; Button: TDBNavButtonType);
begin
NAV_ClickXx(Button);// or PostMessage(Self.Handle, LM_USER, 1, - 2);
end;

I get this error, and I cannot handle where is it.

Project UGS_Dental raised exception class 'External: SIGFPE'.

In file 'lclproc.pas' at line 860:

if (length(Msg) div (length(Msg) div 10000))=0 then ;

Click to run and application continue to work normal, after this error:

Division by zero.

Press OK to ignore and risk data corruption.

Press Cancel to kill the program.

But this code is work without error
procedure TFRM_.NAV_Click(Sender: TObject; Button: TDBNavButtonType);
begin Self.Tag := 1; end;
this code or etc simple code work without problem.

regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140404/99927744/attachment.html>

Reply by email

Mattias Gaertner
to FreeMan
Show quoted text 17 lines
Hello, if I use "OnClick" event, example procedure TFRM_.NAV_Click(Sender: TObject; Button: TDBNavButtonType); begin NAV_ClickXx(Button);// or PostMessage(Self.Handle, LM_USER, 1, - 2); end; I get this error, and I cannot handle where is it. Project UGS_Dental raised exception class 'External: SIGFPE'. In file 'lclproc.pas' at line 860: if (length(Msg) div (length(Msg) div 10000))=0 then ;

Have you tried to use the debugger?

Mattias

Reply by email

FreeMan
to Mattias Gaertner

Yes, I tried debugger, debugger stoped onclick, its work step by step after end of onclick event, but loose control message process. mean f8 step jump to qtwidget, idle, and some in code.

Project project1 raised exception class 'External: SIGFPE'.

In file 'lclproc.pas' at line 860:

    if (length(Msg) div (length(Msg) div 10000))=0 then ;

first this error popup, click "okay" and then jump to that line in editor and wait, then click to run and
this error popup

Debugger exception class 'RunError(200).
in file 'lclproc.pas' at line 860

Break, continue button. Click to continue button and

Debugger Exception Notification
Project project1 raised exception class 'EDivByZero' with message: Division by zero
in file 'lclproc?pas' at line 860

Break, continue button. Click to continue button and last error :)

Division by zero.

Press OK to ignore and risk data corruption.

Press Cancel to kill the program.

program work normal. Test code on down. Message triggered open different form, application work normal, if click insert or any button this error list same.

procedure TFRM_.NAV_Click(Sender: TObject; Button: TDBNavButtonType);
begin
   NAV_Clickx(Button);
end;
procedure TFRM_.NAV_Clickx(Button: TDBNavButtonType);
begin
  case Button of
    nbInsert : PostMessage(Self.Handle, LM_USER, 1, - 2);
    nbDelete : ;
    nbEdit   : ;
  end;
end;

05-04-2014 05:57 tarihinde, Mattias Gaertner yazd?:

Show quoted text 7 lines
In file 'lclproc.pas' at line 860: if (length(Msg) div (length(Msg) div 10000))=0 then ; Have you tried to use the debugger? Mattias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140405/3fa5acd2/attachment.html>

Reply by email