Recent

Author Topic: TMainMenuComponentEditor: Invalid floating point operation  (Read 496 times)

linuxfan

  • New member
  • *
  • Posts: 26
TMainMenuComponentEditor: Invalid floating point operation
« on: June 20, 2019, 07:36:48 am »
Hi all,

I converted a delphi project to lazarus under linux. Convertion went acceptably smooth, the program runs and all works but... at a certain point I decided to modify my main menu. The menu editor does not show up and, instead, this message rises up:

Class component editor "TMainMenuComponentEditor" raised the error "Invalid floating point operation"

(my message is in italian, I quote it in english - maybe inaccurate).

I also have a TPopupMenu which works flawlessly; I've take a look at the LFM file and it has nothing strange in it, the two menus (main and popup) are in there.

What the heck? What could I try? Of course I can edit mainmenu by hand in the LFM... but this is strage problem!


EganSolo

  • Full Member
  • ***
  • Posts: 140
Re: TMainMenuComponentEditor: Invalid floating point operation
« Reply #1 on: July 19, 2019, 02:01:33 am »
Hi Linuxfan,

Quick question: Have you tested your app in non-debug mode, or running outside the IDE? This would help determine if it's a debugger issue or bug of the menu component.

Next: Did you try a divide-and-conquer approach where you'd start by removing half of the menu entries and run it to see if you've got the same problem? Using this method might help you hone down the area of the error.

Egan.

lucamar

  • Hero Member
  • *****
  • Posts: 1824
Re: TMainMenuComponentEditor: Invalid floating point operation
« Reply #2 on: July 19, 2019, 07:17:59 am »
Egan: The problem seems to be with the designer, not at runtime.

linuxfan, try a simple trick: cut and paste the menu (the component in the form, in the designer). That should trigger a "test" of the menu (to see if it can be safely pasted as a component)  and should allow you to check where the problem (if any) was--by comparing the "old" and "new" menus.
« Last Edit: July 19, 2019, 07:20:52 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

EganSolo

  • Full Member
  • ***
  • Posts: 140
Re: TMainMenuComponentEditor: Invalid floating point operation
« Reply #3 on: July 19, 2019, 08:25:07 am »
By cut and paste: did you mean the menu component on the form?
If so, I've cut and pasted the menu on the same form. I've also copied and pasted on the same form and then I've copied and pasted on another form and I've not encountered that bug.

Have you tried simplifying the menu and trying again?

wp

  • Hero Member
  • *****
  • Posts: 5842
Re: TMainMenuComponentEditor: Invalid floating point operation
« Reply #4 on: July 19, 2019, 09:49:26 am »
How did you do the conversion of the Delphi project to Lazarus? With the converter in the "Tools menu? I tried it with a sample project, but there were several places that I had to rework manually (maybe because I simply do no use the converter very often). In the end, however, the converted project behaves normally, in particular the menu editor.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

lucamar

  • Hero Member
  • *****
  • Posts: 1824
Re: TMainMenuComponentEditor: Invalid floating point operation
« Reply #5 on: July 19, 2019, 12:45:53 pm »
By cut and paste: did you mean the menu component on the form?
If so, I've cut and pasted the menu on the same form. I've also copied and pasted on the same form and then I've copied and pasted on another form and I've not encountered that bug.

Yes, I meant that, although it was meant for the OP :). There is no reason for it to give problems on a normal Lazarus project but it may help locate errors in converted or manualy added definitions.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.