Re: [fpc-pascal] Forward type not resolved

2011-03-04 Thread Marco van de Voort
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:\fpcfpc 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.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forward type not resolved

2011-03-03 Thread Leonardo M . Ramé
--- On Thu, 3/3/11, Leonardo M. Ramé martinr...@yahoo.com wrote:
 From: Leonardo M. Ramé martinr...@yahoo.com
 Subject: [fpc-pascal] Forward type not resolved
 To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
 Date: Thursday, March 3, 2011, 8:06 PM
 Hi, I'm trying to create a forward
 declaration for a class, as I use to do in Delphi, but I'm
 getting Forward type not resolved. How can I troubleshoot
 this?.
 
 Here's the code:
 
 {$mode objfpc}{$H+}
 
 interface
 
 uses
   Classes, SysUtils; 
 
 type
   TQuote = class; // forward declaration.
 
   TOnSqueeze = procedure (AQuote: TQuote); of object;
 
   { TQuote }
 
   TQuote = class(TCollectionItem)
   private
     FAdjClose: Double;
     FBBand_Diff: Double;
   ...
 
 And, this is the error I'm getting:
 
 quote.pas(11,12) Error: Forward type not resolved TQuote
 

Sorry, the error was here:

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

This line should be:

   TOnSqueeze = procedure (AQuote: TQuote) of object;

Leonardo M. Ramé
http://leonardorame.blogspot.com

 



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forward type not resolved

2011-03-03 Thread waldo kitty

On 3/3/2011 17:15, Leonardo M. Ramé wrote:

Sorry, the error was here:

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

This line should be:

TOnSqueeze = procedure (AQuote: TQuote) of object;


amazing what a misplaced semi-colon will do, eh? ;)

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?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forward type not resolved

2011-03-03 Thread Jorge Aldo G. de F. Junior
im still trying to understand how the compiler understood that
sentence in order to generate THAT specific error... (while ignoring a
totally out of place 'of' token)

2011/3/3 waldo kitty wkitt...@windstream.net:
 On 3/3/2011 17:15, Leonardo M. Ramé wrote:

 Sorry, the error was here:

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

 This line should be:

    TOnSqueeze = procedure (AQuote: TQuote) of object;

 amazing what a misplaced semi-colon will do, eh? ;)

 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?
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal