Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: Jan-Jaap van der Heijden
Subject: BP style objects: errors.
Date: 24 Apr 1997, 15:12:01
Hello,
Using gpc to compile (some parts of) Borland's objects unit, I noticed
this (so far):
1) References to an incomplete type are not accepted. In the code below,
CopyFrom uses a variable S of type TStream, while TStream is not yet
finished:
type
PStream = ^TStream;
TStream = object(TObject)
Status: Integer;
ErrorInfo: Integer;
constructor Init;
procedure CopyFrom(var S: TStream; Count: Longint);
...
BP accepts this, gpc barfs: "type name expected, identifier `Tstream'
given"
2) Something simular appens in the implementation part:
procedure TStream.Error(Code, Info: Integer);
type
TErrorProc = procedure(var S: TStream);
begin
Status := Code;
ErrorInfo := Info;
if StreamError <> nil then TErrorProc(StreamError)(Self);
end;
This results in an error:
objects.pas: In function `Tstream_Error':
objects.pas:141: `object' type definition only allowed at top level
objects.pas:141: parse error before `Procedure'
objects.pas:142: pointer domain type `Terrorproc' undefined
objects.pas:145: undeclared identifier `Terrorproc' (first use this
function)
objects.pas:145: (Each undeclared identifier is reported only once
objects.pas:145: for each function it appears in.)
objects.pas:145: parse error before `('
objects.pas:145: missing semicolon
objects.pas:145: missing semicolon
3) Obviously, `self' is treated different too...
All of this with the latest-but-one alpha release, in BP mode with
extended syntax.
BTW: of course, what I was trying out, was how much trouble it would be to
port TVision to GPC. Seems we have a long way to go....
Greetings,
JanJaap
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).