[Lazarus] Frog game. OO-izing SDL. Replace record with class then Lazarus can't find .create or .free for class

Pew (piffle.the.cat) piffle.the.cat at iinet.net.au
Fri Jan 28 21:23:29 CET 2011


Hi All,

http://hotfile.com/dl/100225293/35136c1/frog_game.tar.gz.html

I am modernising the SDL unit by replacing all of the records with 
classes. This should avoid warnings.

basically all

whatever = record
   x : integer;
   // blah blah blah
end;

becomes

whatever = class
   public
     x : integer;
     // blah blah blah
end;

and then

var
   whatever1 : whatever;
begin
   // new(whatever1);
   // becomes
   whatever1 := whatever.create;
...

uFixedWidthFonts.pas(98,21) Error: Unknown record field identifier "CREATE"
uFixedWidthFonts.pas(177,17) Error: Operator is not overloaded
uFixedWidthFonts.pas(182,16) Error: Unknown record field identifier "FREE"
uFixedWidthFonts.pas(253) Fatal: There were 3 errors compiling module, 
stopping

and Lazarus does not understand how to do a

whatever1.whatever.create;
nor a
whatever1.free;

Best Regards,
pew




More information about the Lazarus mailing list