> On Jan 8, 2017, at 5:36 PM, Ryan Joseph <r...@thealchemistguild.com> wrote:
> 
> Casting TObject(input) := obj; worked but the value of “io” is still not 
> getting set. Because it’s a var I expected the value to be returned to the 
> caller. 

Never mind, I got it working, stupid mistake in my testing.

yes just like that function. I just learned about absolute so I was making us 
of it. Seems to work the same as casting in FreeAndNil. Thanks for helping.

    procedure FreeAndNil(var obj);
      var
        temp: tobject;
      begin
        temp:=tobject(obj);
        pointer(obj):=nil;
        temp.free;
      end;


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to