Vote UpVote

Porting Delphi 2006 to XE2, fields versus properties: tightened compiler error E2197

The Wiert Corner – When porting some communications code that used records as properties from Delphi 2006 to Delphi XE2, I came across a tightened compiler error “E2197 Constant object cannot be passed as var parameter“. Let me first explain the good old occurrence of E2197 with some code that uses my last Variant Records example: Just look at TPacket.InitializePacket and TPacketBase.InitializeFPacket: Basically even though the Packet property has storage specifiers indicating it directly reads from a field and directly writes to a field, you cannot pass it as a var parameter in the FillChar method. ...
Favorite? Off-Topic? jpluimers @ 2013-03-19 06:00


Visits: 1057
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)