Sign in Join

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

Mailing lists / lazarus / 2009-10

Setting events - Bug?

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Guionardo Furlan
Hello, this is the situation (lazarus 0.9.29 - fpc 2.3.1):
TMyClass = class
  private
    FNotifica: TNotifyEvent;
      procedure SetNotifica(const AValue: TNotifyEvent);
published
  property Notifica: TNotifyEvent read FNotifica write SetNotifica;
end;
var MyClass: TMyClass;

This is OK.

On another unit, I have:

TAnotherClass = class
public
  procedure DoNotifica(Sender: TObject);
  procedure SetLinks;
end;
procedure TAnotherClass.SetLinks;
begin
  MyClass.Notifica:=self.DoNotifica; // <--- This is the problem
end;

and, when fpc compile this I get:

fopessoas.pp(41,39) Error: Wrong number of parameters specified for call to
"NotificaInfo"
fopessoas.pp(22,15) Hint: Found declaration:
TfPessoas.NotificaInfo(TObject);
fopessoas.pp(91) Fatal: There were 1 errors compiling module, stopping

Well, what can I do?

Timeo hominem unius libri Cogito ergo sum - Carpe diem []s Guionardo Furlan http://guionardo.blogspot.com http://www.guionardofurlan.com.br -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091002/0ae78c0a/attachment.html>

Reply by email

Mattias Gaertner
to Guionardo Furlan
Show quoted text 24 lines
Hello, this is the situation (lazarus 0.9.29 - fpc 2.3.1): TMyClass = class private FNotifica: TNotifyEvent; procedure SetNotifica(const AValue: TNotifyEvent); published property Notifica: TNotifyEvent read FNotifica write SetNotifica; end; var MyClass: TMyClass; This is OK. On another unit, I have: TAnotherClass = class public procedure DoNotifica(Sender: TObject); procedure SetLinks; end; procedure TAnotherClass.SetLinks; begin MyClass.Notifica:=self.DoNotifica; // <--- This is the problem
 ; // <--- This is the solution
Show quoted text 11 lines
end; and, when fpc compile this I get: fopessoas.pp(41,39) Error: Wrong number of parameters specified for call to "NotificaInfo" fopessoas.pp(22,15) Hint: Found declaration: TfPessoas.NotificaInfo(TObject); fopessoas.pp(91) Fatal: There were 1 errors compiling module, stopping Well, what can I do?

Mattias

Reply by email

Guionardo Furlan
to Mattias Gaertner

I swear I tried this before, but the error was the same. Now, it worked! Must be the elves who live under my desk!

Thanks

2009/10/2 Mattias Gaertner

Show quoted text 52 lines
On Fri, 2 Oct 2009 14:11:00 -0300 Guionardo Furlan wrote: > Hello, this is the situation (lazarus 0.9.29 - fpc 2.3.1): > TMyClass = class > ? private > ? ? FNotifica: TNotifyEvent; > ? ? ? procedure SetNotifica(const AValue: TNotifyEvent); > published > ? property Notifica: TNotifyEvent read FNotifica write SetNotifica; > end; > > var MyClass: TMyClass; > > This is OK. > > On another unit, I have: > > TAnotherClass = class > public > ? procedure DoNotifica(Sender: TObject); > ? procedure SetLinks; > end; > > procedure TAnotherClass.SetLinks; > begin > ? MyClass.Notifica:=self.DoNotifica; // <--- This is the problem ; // <--- This is the solution > end; > > and, when fpc compile this I get: > > fopessoas.pp(41,39) Error: Wrong number of parameters specified for > call to "NotificaInfo" > fopessoas.pp(22,15) Hint: Found declaration: > TfPessoas.NotificaInfo(TObject); > fopessoas.pp(91) Fatal: There were 1 errors compiling module, stopping > > Well, what can I do? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Timeo hominem unius libri Cogito ergo sum - Carpe diem []s Guionardo Furlan http://guionardo.blogspot.com http://www.guionardofurlan.com.br

Reply by email

Guionardo Furlan
to Guionardo Furlan

Well, new problem.

The compilation is ok.
But, in run-time I get:
Project de.exe raised exception class 'EReadError' with message: Invalid value for property

2009/10/2 Guionardo Furlan :

Show quoted text 70 lines
I swear I tried this before, but the error was the same. Now, it worked! Must be the elves who live under my desk! Thanks 2009/10/2 Mattias Gaertner > > On Fri, 2 Oct 2009 14:11:00 -0300 > Guionardo Furlan wrote: > > > Hello, this is the situation (lazarus 0.9.29 - fpc 2.3.1): > > TMyClass = class > > ? private > > ? ? FNotifica: TNotifyEvent; > > ? ? ? procedure SetNotifica(const AValue: TNotifyEvent); > > published > > ? property Notifica: TNotifyEvent read FNotifica write SetNotifica; > > end; > > > > var MyClass: TMyClass; > > > > This is OK. > > > > On another unit, I have: > > > > TAnotherClass = class > > public > > ? procedure DoNotifica(Sender: TObject); > > ? procedure SetLinks; > > end; > > > > procedure TAnotherClass.SetLinks; > > begin > > ? MyClass.Notifica:=self.DoNotifica; // <--- This is the problem > > ; // <--- This is the solution > > > > end; > > > > and, when fpc compile this I get: > > > > fopessoas.pp(41,39) Error: Wrong number of parameters specified for > > call to "NotificaInfo" > > fopessoas.pp(22,15) Hint: Found declaration: > > TfPessoas.NotificaInfo(TObject); > > fopessoas.pp(91) Fatal: There were 1 errors compiling module, stopping > > > > Well, what can I do? > > > Mattias > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Timeo hominem unius libri Cogito ergo sum - Carpe diem []s Guionardo Furlan http://guionardo.blogspot.com http://www.guionardofurlan.com.br
Timeo hominem unius libri Cogito ergo sum - Carpe diem []s Guionardo Furlan http://guionardo.blogspot.com http://www.guionardofurlan.com.br

Reply by email

Martin
to Guionardo Furlan
Guionardo Furlan wrote 7 lines
Well, new problem. The compilation is ok. But, in run-time I get: Project de.exe raised exception class 'EReadError' with message: Invalid value for property

May be an unrelated issue.

Check if the *.lrs file is ok. Or simply delete the lfr file (while the form is open) and save the form, so the file is created again.

Do you use VirtualBox? (There is an issue which leads to this error)

Martin

Reply by email

Guionardo Furlan
to Martin

Ok, this is the explanation:

The MyClass is TFrame, and docked into another form (TAnotherClass). I've altered some properties on the frame, and this was not reflected on the object in the form.
So, I deleted the frame and inserted a new one in the form. Everything is ok now.

Thanks for the help.

2009/10/2 Martin :

Show quoted text 26 lines
Guionardo Furlan wrote: > > Well, new problem. > > The compilation is ok. > But, in run-time I get: > Project de.exe raised exception class 'EReadError' with message: > Invalid value for property > May be an unrelated issue. Check if the *.lrs file is ok. Or simply delete the lfr file (while the form is open) and save the form, so the file is created again. Do you use VirtualBox? (There is an issue which leads to this error) Martin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Timeo hominem unius libri Cogito ergo sum - Carpe diem []s Guionardo Furlan http://guionardo.blogspot.com http://www.guionardofurlan.com.br

Reply by email