Sign in Join

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

Mailing lists / lazarus / 2012-01

codetools: class helper: unit1.pas(20, 30) Error: : expected, but for found

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Marcos Douglas

Hi,

I can't navigate using Ctrl+Shift+C if unit has a class helper. If you try in code below, you got the error: "expected, but for found"

But this code compiles without problems.

unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
type
  TForm1 = class(TForm)
  private
    { private declarations }
  public
    { public declarations }
    procedure A;
    procedure B;
  end;
  TFormHelper = class helper for TForm1
  public
    procedure C;
  end;
var
  Form1: TForm1;
implementation
{$R *.lfm}

{ TForm1 }

procedure TForm1.A;
begin
end;
procedure TForm1.B;
begin
end;
procedure TFormHelper.C;
begin
end;
end.
Marcos Douglas

Reply by email

Mattias Gaertner
to Marcos Douglas
Show quoted text 53 lines
Hi, I can't navigate using Ctrl+Shift+C if unit has a class helper. If you try in code below, you got the error: "expected, but for found" But this code compiles without problems. unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs; type TForm1 = class(TForm) private { private declarations } public { public declarations } procedure A; procedure B; end; TFormHelper = class helper for TForm1 public procedure C; end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.A; begin end; procedure TForm1.B; begin end; procedure TFormHelper.C; begin end; end.

There is already a bug report:
http://bugs.freepascal.org/view.php?id=20623

Mattias

Reply by email

Marcos Douglas
to Mattias Gaertner
Mattias Gaertner wrote 59 lines
On Mon, 30 Jan 2012 09:48:58 -0300 Marcos Douglas wrote: > Hi, > > I can't navigate using Ctrl+Shift+C if unit has a class helper. > If you try in code below, you got the error: "expected, but for found" > > But this code compiles without problems. > > unit Unit1; > > {$mode objfpc}{$H+} > > interface > > uses > ? Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs; > > type > ? TForm1 = class(TForm) > ? private > ? ? { private declarations } > ? public > ? ? { public declarations } > ? ? procedure A; > ? ? procedure B; > ? end; > > ? TFormHelper = class helper for TForm1 > ? public > ? ? procedure C; > ? end; > > var > ? Form1: TForm1; > > implementation > > {$R *.lfm} > > { TForm1 } > > procedure TForm1.A; > begin > end; > > procedure TForm1.B; > begin > end; > > procedure TFormHelper.C; > begin > end; > > end. There is already a bug report: http://bugs.freepascal.org/view.php?id=20623

Worked perfectly, thanks.

Marcos Douglas

Reply by email