[fpc-pascal] Forward type not resolved

Marco van de Voort marcov at stack.nl
Fri Mar 4 09:30:14 CET 2011


In our previous episode, Florian Klaempfl said:
> > i would have thought that there would have been an additional error
> > concerning the trailing "of object"... was there? did it give a clue as
> > to the actual error of the misplaced semi-colon?
> 
> c:\fpc>fpc test.pp
> Free Pascal Compiler version 2.4.2 [2010/11/10] for i386
> Copyright (c) 1993-2010 by Florian Klaempfl
> Target OS: Win32 for i386
> Compiling test.pp
> test.pp(7,12) Error: Forward type not resolved "TQuote"
> test.pp(9,44) Fatal: Syntax error, "BEGIN" expected but "OF" found
> 
> Unfortunatly, Leonardo did not post a complete example but this is what
> I get by guessing the missing parts.

He did on IRC. Note that the error is different depending on  = class; or =
class(tcollectionitem);

I used 2.5.1 (week old) tho.

unit quote;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type
  TQuote = class;  // (TCollectionItem);  // change thise for a different
error

  TOnSqueeze = procedure (AQuote: TQuote); of object;

  { TQuote }

  TQuote = class(TCollectionItem)
  private
    FAdjClose: Double;
    FBBand_Diff: Double;
    FBBand_Lower: Double;
    FBBand_Middle: Double;
    FBBand_Upper: Double;
    FClose: Double;
    end;

implementation

end.



More information about the fpc-pascal mailing list