[lazarus] the party can start ;)

Michael A. Hess mhess at miraclec.com
Tue May 18 12:35:28 EDT 1999


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.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list