Sign in Join

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

Mailing lists / lazarus / 1999-05

the party can start ;)

8 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller

What bug are you referring to? The "self" bug that's kicked our a## for so long or something else? Also, what was the fix? Do we pull a new FCL, GTK, and FPC?

Shane

>> Peter Vreman 05/18 8:38 AM >>>

I've removed the bug with the Self bug and the procvar assigning which Michael VC posted lastly.

The only change needed in the source is that you need to declare the procvar also using self, else the compiler doesn't know that you want to call a procedure which gets self instead of the normal class

The other error in the source from MVC is a typo bug which you may fix yourself ;)

Peter

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Peter Vreman

I've removed the bug with the Self bug and the procvar assigning which Michael VC posted lastly.

The only change needed in the source is that you need to declare the procvar also using self, else the compiler doesn't know that you want to call a procedure which gets self instead of the normal class

The other error in the source from MVC is a typo bug which you may fix yourself ;)

Peter

Reply by email

Michael A. Hess
to Peter Vreman: The bug with the self as parameter of a message function Peter
Peter Vreman wrote
I don't know much about the classes so you need to provide examples of code which doesn't work

OK here is the same example I sent to Michael V. He indicated that I am trying to use it correctly but this example will die big time when you try and run it.

I have also found that the procedure setup as a message MUST have a leading variable before the Self. For example I have placed var b : integer
first. If I don't do this then the compiler dies big time to the point of blowing away the terminal I am working in. What I don't understand is how you are suppose to use this leading variable. The DispatchStr doesn't seem to make any use of it and I can't see how you are suppose to supply data for this variable in a call.

Maybe you can explain it to me. :-)

program test;
{$mode objfpc}
type
   TMyObject = Class (Tobject)
      procedure DoClick(var b : integer; Self : TMyObject); message
'click';
      procedure Test;
   end;
procedure TMyObject.DoClick(var b : integer; Self : TMyObject);
begin
   writeln ('Called DoClick');
end;
procedure TMyObject.Test;
var
   msg : string;
begin
   msg := 'click';
   DispatchStr(msg);
end;
var
   MyObject : TMyObject;
begin
   MyObject:=TMyObject.Create;
   MyObject.Test;
   MyObject.Free;
end.
==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Sergio Kessler
to Peter Vreman: The bug with the self as parameter of a message function Peter
"Michael A. Hess" wrote 53 lines
Peter Vreman wrote: > > I don't know much about the classes so you need to provide examples of > code which doesn't work OK here is the same example I sent to Michael V. He indicated that I am trying to use it correctly but this example will die big time when you try and run it. I have also found that the procedure setup as a message MUST have a leading variable before the Self. For example I have placed var b : integer first. If I don't do this then the compiler dies big time to the point of blowing away the terminal I am working in. What I don't understand is how you are suppose to use this leading variable. The DispatchStr doesn't seem to make any use of it and I can't see how you are suppose to supply data for this variable in a call. Maybe you can explain it to me. :-) program test; {$mode objfpc} type TMyObject = Class (Tobject) procedure DoClick(var b : integer; Self : TMyObject); message 'click'; procedure Test; end; procedure TMyObject.DoClick(var b : integer; Self : TMyObject); begin writeln ('Called DoClick'); end; procedure TMyObject.Test; var msg : string; begin msg := 'click'; DispatchStr(msg); end; var MyObject : TMyObject; begin MyObject:=TMyObject.Create; MyObject.Test; MyObject.Free; end.

ok, you call DispatchStr(msg); then how gtk is called ?

| Sergio A. Kessler http://perio.unlp.edu.ar/~sergio -O_O- Keep working at it... you will either succeed, or become an expert.

Reply by email

Peter Vreman
to Shane Miller: What bug are you referring to? The "self" bug that's kicked our a## for so long or…
What bug are you referring to? The "self" bug that's kicked our a## for so long or something else? Also, what was the fix? Do we pull a new FCL, GTK, and FPC?

The bug with the self as parameter of a message function

Peter

Show quoted text 28 lines
Shane >>> Peter Vreman 05/18 8:38 AM >>> I've removed the bug with the Self bug and the procvar assigning which Michael VC posted lastly. The only change needed in the source is that you need to declare the procvar also using self, else the compiler doesn't know that you want to call a procedure which gets self instead of the normal class The other error in the source from MVC is a typo bug which you may fix yourself ;) Peter _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Peter Vreman
to Peter Vreman
you wrote 6 lines
Peter Vreman wrote: > > The bug with the self as parameter of a message function Was this bug also keeping DispatchStr from working correctly? I ask because I can't seem to get it to work.

Don't think it. The bug was only a push of %esi to much for self functions. And the others were only typechecking things which didn't affect the generated code.

I don't know much about the classes so you need to provide examples of code which doesn't work

Reply by email

Michael A. Hess
to Peter Vreman: The bug with the self as parameter of a message function Peter
Sergio Kessler wrote
ok, you call DispatchStr(msg); then how gtk is called ?

You will see and understand when I get it working. The FPC part of DispatchStr which is in objpas.pp isn't working right.

In a nut shell gtk will be calling DispatchStr not the other way around.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email