Sign in Join

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

Mailing lists / lazarus / 2019-05

Lazarus throws error when trying to open an event procedure from the form

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

FPC 3.0.4 / Lazarus 2.0.0 32 bit on Windows 7 x64

A project that builds without errors or warnings throws up an error dialog whenever in order to see its event function I do:
1) Doubleclick a button in the form view
2) Select the button, then use the events tab in object inspector to open OnClick

The error box says:

Unable to show method. Please fix the error shown in the message window which is normally below the
source editor.

And the message window has this:

Codetools, Errors: 1
formmain.pas(119,4) Error: End of source not found.

The editor cursor is set here (which is NOT where I wantde to get to):

procedure TfrmMain.vlcPlayerMediaPlayerTimeChanged(Sender: TObject;
time: Int64);
begin
  if trkPosition.Tag = 0 then // not dragging with mouse
    trkPosition.Position := vlcPlayer.GetVideoPosInMs();
  lblTime.Caption := vlcPlayer.GetVideoPosStr('hh:mm:ss.ms');
end;

Still as I said the project has no errors and builds just fine, why this message?

If I close Lazarus and then start it over again, then this strange behaviour is not repeated.....

Do I need to file a bug report or is this just a natural thing like restarting Windows to fix issues?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Ondrej Pokorny
Ondrej Pokorny wrote

Thanks for the info!
So I checked the ticket when I had the same problem reappear again today. Turns out that when the problem is "active" I tested (as suggested in the ticket comments) adding the following immediately below implementation:
uses

  Types;

Then I tested again to get to the event function by doubleclicking the button and now it worked fine!
And that is without restarting Lazarus.

So it is definitely something fishy going on with codetools.

Bo Berglund Developer in Sweden

Reply by email