| View previous topic :: View next topic |
| Author |
Message |
Mark Horrocks Guest
|
Posted: Thu Mar 22, 2007 2:10 pm Post subject: D7 to BDS2006 Ownerdata problem |
|
|
The following code will not compile in BDS2006 but has been fine in D7
procedure TGame.dspGameIncidentsIExBeforeGetRecords(Sender: TObject; var
OwnerData: OleVariant);
.....
with Sender as TDataSetProvider do
vArray := GetParams(OwnerData);
The error is
[Pascal Error] RDM_Games.pas(799): E2197 Constant object cannot be passed as
var parameter
Any ideas as to how to fix this?
Mark Horrocks |
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Fri Mar 23, 2007 12:42 am Post subject: Re: D7 to BDS2006 Ownerdata problem |
|
|
Mark Horrocks wrote:
| Quote: | The following code will not compile in BDS2006 but has been fine in D7
procedure TGame.dspGameIncidentsIExBeforeGetRecords(Sender: TObject;
var OwnerData: OleVariant);
....
with Sender as TDataSetProvider do
vArray := GetParams(OwnerData);
The error is
[Pascal Error] RDM_Games.pas(799): E2197 Constant object cannot be
passed as var parameter
Any ideas as to how to fix this?
|
Mark,
as a first step to figuring out what is wrong here, get rid of the With
statement! Add a local variable
var
Provider: TDatasetProvider;
Provider := Sender as TDatasetProvider;
vArray := Provider.GetParams(OwnerData);
--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be |
|
| Back to top |
|
 |
Mark Horrocks Guest
|
Posted: Wed Apr 11, 2007 6:44 am Post subject: Re: D7 to BDS2006 Ownerdata problem |
|
|
| Quote: | as a first step to figuring out what is wrong here, get rid of the With
statement! Add a local variable
var
Provider: TDatasetProvider;
Provider := Sender as TDatasetProvider;
vArray := Provider.GetParams(OwnerData);
Thanks Peter, this has fixed the problem |
Mark Horrocks |
|
| Back to top |
|
 |
|