A compiler enhancement which I am sure does not work in Delphi could really move FPC to the present...Code: Pascal [Select][+][-] SomeProperty := With SomeOtherProperty do begin // make all the changes here to the property body given. // do other unrelated things. End; That would allow a visible entity to be assigned to a sub entity when the block completes. Now that would move FPC to the space age!
IMHO, a function works just as well and is more readable:Code: Pascal [Select][+][-]function DoSomethingWith(var AProperty: TWhateverType): TSomeOtherType;begin with AProperty do begin // make all the changes here to the property body given. // do other unrelated things. end;end; {... lots of other code ...} SomeProperty := DoSomethingWith(SomeOtherProperty);It'll also isolate in the function's body any side-effects the block of code has, which is nice for debugging.