BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

D7 to BDS2006 Ownerdata problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Upgrade
View previous topic :: View next topic  
Author Message
Mark Horrocks
Guest





PostPosted: Thu Mar 22, 2007 2:10 pm    Post subject: D7 to BDS2006 Ownerdata problem Reply with 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 Horrocks
Back to top
Peter Below (TeamB)
Guest





PostPosted: Fri Mar 23, 2007 12:42 am    Post subject: Re: D7 to BDS2006 Ownerdata problem Reply with quote



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





PostPosted: Wed Apr 11, 2007 6:44 am    Post subject: Re: D7 to BDS2006 Ownerdata problem Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Upgrade All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.