Loodziek
01-12-2007, 05:52 PM
Hi again guys. Well I was try to create my class but I've got a problem. I don't know what's wrong with it, I can't find any answer too... So I post my problem here... You, experienced pascal programmers should know what's wrong, because it's stopping me... Ok, I end of bullshit, now - to the main thing. There's my Lazarus (freepascal) code:
program myclass;
{$mode objfpc}{$H+}
//CLASS TMYCLASS
type
TMyClass = class
private
Started : boolean;
Paused : boolean;
public
constructor Create;
procedure Start;
end;
//TMYCLASS PROCEDURES
constructor TMyClass.Create;
begin
Started := false;
Paused := false;
end;
procedure TMyClass.Start;
begin
Started := true;
Paused := false;
end;
//-----------------------------------
var
Example : TMyClass;
begin
Example.Create;
Example.Start;
ReadLn;
end.
Problem's in TMyClass.Start procedure. When I copy all TMyClass.Start code to TMyClass.Create everything's ok. But what's wrong with it? Anyway, thanks for any replies ;-) Happy pascal coding!
program myclass;
{$mode objfpc}{$H+}
//CLASS TMYCLASS
type
TMyClass = class
private
Started : boolean;
Paused : boolean;
public
constructor Create;
procedure Start;
end;
//TMYCLASS PROCEDURES
constructor TMyClass.Create;
begin
Started := false;
Paused := false;
end;
procedure TMyClass.Start;
begin
Started := true;
Paused := false;
end;
//-----------------------------------
var
Example : TMyClass;
begin
Example.Create;
Example.Start;
ReadLn;
end.
Problem's in TMyClass.Start procedure. When I copy all TMyClass.Start code to TMyClass.Create everything's ok. But what's wrong with it? Anyway, thanks for any replies ;-) Happy pascal coding!