Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > .NET

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2008, 06:38 AM
cuterita7 cuterita7 is offline
Member
 
Join Date: Apr 2008
Posts: 92
Default VCL.NET

Hi

I am migrating from VCL to VCL.NET,I got the following error "Constant object cannot be passed as var parameter" at the following line:
Settables(TMSTable(DataSet),sconn);

My code is:
procedure TFrmMain.TblInitialization(DataSet: TDataSet);
var
begin
Settables(TMSTable(DataSet),sconn);
end;

Procedure TFrmMain.SetTables(var PTables : array of TMSTable;s:String);

Any help please?
thanks
Reply With Quote
  #2  
Old 12-05-2008, 11:39 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: VCL.NET

procedure TFrmMain.TblInitialization(DataSet: TDataSet);
var
ds: TMSTable;
begin
ds := TMSTable(DataSet);
Settables(ds, sconn);
end;

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #3  
Old 12-05-2008, 09:48 PM
cuterita7 cuterita7 is offline
Member
 
Join Date: Apr 2008
Posts: 92
Default RE: VCL.NET

Mike, I tried your suggestion but I still get the same error
'Constant object cannot be passed as var parameter'

any suggestion?
thanks
Reply With Quote
  #4  
Old 12-05-2008, 10:55 PM
cuterita7 cuterita7 is offline
Member
 
Join Date: Apr 2008
Posts: 92
Default RE: VCL.NET

Hi

In the following code:
procedure TFrmMain.TblInitialization(DataSet: TDataSet);
var
ds: TMSTable;
begin
ds := TMSTable(DataSet);
Settables(ds, sconn);
end;

I tried declaring ds as Array of TMSTable because Settables accepts an Array of TMSTable in its first parameter but I got the following error:
Incompatible types: 'Dynamic array' and 'TMSTable'

Any help
Reply With Quote
  #5  
Old 12-07-2008, 11:10 PM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: VCL.NET

Show how did you define the variable (array). In code you posted I do not see any array

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #6  
Old 03-28-2015, 06:25 AM
Roman Roman is offline
Junior Member
 
Join Date: Mar 2015
Posts: 1
Default

This is exceptionally decent and good post....You shook posting it....Thanks a great deal for posting it....!!!



solitairecardgame.info

Last edited by Roman; 12-21-2015 at 11:57 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.