[fpc-devel] test on TP

Tomas Hajny XHajT03 at hajny.biz
Wed May 14 12:32:53 CEST 2014


On Wed, May 14, 2014 12:10, Gerhard Scholz wrote:
> BP 7.0 (real)
> BP7.0 (protected)
> VP2.1b279
>
> all: "not assigned"

Indeed (apart from the obvious typo "endiof" preventing compilation, of
course). Why / how could it give a different result?

Tomas



> ----- Original Message -----
> From: "Marco van de Voort" <marcov at stack.nl>
> To: <fpc-devel at lists.freepascal.org>
> Sent: Wednesday, May 14, 2014 11:46 AM
> Subject: [fpc-devel] test on TP
>
>
>>
>> Can sb test this program on TP/BP7 and tell me the result? Thank you.
>>
>> program sometest;
>>
>> {$ifdef fpc}
>> {$mode tp}
>> {$endiof}
>>
>> Type
>>   PChildThing = ^TChildThing;
>>   TChildThing = object
>>     constructor init;
>>                  end;
>>
>>   PSomething = ^TSomething;
>>   TSomething = object
>>                    ct:PChildThing;
>>     constructor init;
>>                  end;
>>
>>
>> constructor TSomething.init;
>>
>> begin
>>   new(ct,init);
>> end;
>>
>> var p : PSomething;
>>
>> constructor TChildThing.Init;
>> begin
>>  if assigned(p) then
>>    writeln('assigned')
>>  else
>>    writeln('not assigned')
>> end;
>>
>> begin
>>  p:=nil;
>>  p:=new(PSomething,Init);
>> end.





More information about the fpc-devel mailing list