[fpc-pascal]Forward type declaration

Peter Vreman peter at freepascal.org
Wed Apr 23 22:26:58 CEST 2003


> Hi Peter!
>
>> It is already possible.
>>
>> You need to define a pointer type to the record first. See the example
>> for
>> a linked list:
>>
>> type
>>   PRec = ^TRec
>>   TRec = record
>>      next  : PRec;
>>   end;
>
> I tried this. But therefore the declaration of TRec must be immediately
> after the declaration of PRec. Nothing can be in between. But this would
> be necessary for my case.

It should be in the same type block.  That should (always?) be possible to
manage as type declarations are not dependent on code, maybe on constants,
but constants are not dependent on structured types.

Peter




More information about the fpc-pascal mailing list