Re: [DelphiDoc-News] Typed Pointers
Brought to you by:
gveith
|
From: Gerold V. <Del...@gm...> - 2005-07-02 15:45:20
|
vaa20003 wrote:
> Has disconnected check @ - beginning to compile further but
>
> var Positions :PPoint; //the positions of all files (boxes)
> Files :^TPascalFile; //the list of all written files
> NextUnit :TPoint; //position of the next file to write
>
> {Draws a file at the current position and moves the pointer for the next one.
> ~param Index index in the list of files
> ~param CountPerColumn number of files in a column; 0: as many as fit }
> procedure DrawFile(Index: Cardinal; CountPerColumn: Cardinal = 0);
> var FileP :^TPascalFile; //entry in list of written files
> PositionP :PPoint; //entry in list of positions of files
> begin
> PositionP := Positions;
> inc(PositionP, Index);
> if PositionP.x = -1 then //file not yet written?
> begin
> FileP := Files; - write thet incompatibile type
>
> I do not understand!
You have to use typed pointers to compile DelphiDoc. Either use the project
options to set it or use the compiler comment {$T+} or {$TYPEDADDRESS ON}
in each file.
This error happens because ^TPascalFile and ^TPascalFile are two different
types for the compiler (see in Delphi's help file on "$T"). A solution
would be to declare the
type PPascalFile = ^TPascalFile;
and use it instead of the different occurences of ^TPascalFile.
I (personally) strongly suggest to enable the type check of the pointers in
every project.
Regards, Gerold Veith
|