[fpc-pascal]OOP - What is wrong here? Please help!

Stefan Becker becker at lufa-sp.vdlufa.de
Wed Oct 10 12:35:16 CEST 2001


Hi Rainer,

The problem is simple!
throughout the diffiations of all the object data...

type
 kkfdslk = object......
 procedure .....
 ect...


Now use have used correctly make the objects and methodes.....
> type
> otest = object(oBrowser)
>           procedure Load; virtual;
>         end;
> 			  
> procedure otest.load;
> begin
> end;

Okay
But, up to this point there has NEVER been an
alocation of real memory.  These are ALL "type" definitions.

Wrong!
> begin
> 	otest.Init(1,1,80,25,white,white,'Hallo');
> 	
> 	delay(6000);
> 	
> 	otest.done;
> end.

This should read something like this:
VAR
 st_x : otest;    {<-- the first time memory is reserved}
 {or dynamik}
 dy_x : ^otest;   {<-- only uses a pointer of memory}

begin
 st_x.Init(1,1,80,25,white,white,'Hallo');
 delay(6000);
 st_x.done;

{or}
  dy_x:=new(dy_x,init(1,1,80,25,white,white,'Hallo'));
  delay(6000);
  dispose(dy_x,done);
end.

LUFA Speyer (EDV)
email: becker at lufa-sp.vdlufa.de
tel  : +49 (0)6232-629542
fax  : +49 (0)6232-629544
http://www.lufa-speyer.de/






More information about the fpc-pascal mailing list