OleVariant Problem with Delphi 6

top204
04-19-2004, 06:48 AM
Hello

I'm trying to use the Item property within Delphi 6 such as: -

FMap.Shapes.Item[1].Name := 'my name';

but it keeps giving me the erorr message: -

Types of actual and formal var parameters must be identical

I must admit, I'm lost around variants and Olevariants, so I don't know where to start looking for a problem.

Any help would be appreciated.

Thanks in advance.

Les

Anonymous
04-19-2004, 09:48 AM
Top204:

You first need to define a variable to store the item number. In your routine, create a variable defined as an olevariant. For example:


procedure TFMain.AssignName;
var i:olevariant;
begin
FMap.Shapes.Item[i].Name := 'my name';
end;

That should do it.

Anonymous
04-19-2004, 09:50 AM
Top204:

You first need to define a variable to store the item number. In your routine, create a variable defined as an olevariant. For example:


procedure TFMain.AssignName;
var i:olevariant;
begin
i := 1;
FMap.Shapes.Item[i].Name := 'my name';
end;

That should do it.[/quote]

Anonymous
04-29-2004, 04:51 AM
Sorry for the delay in replying.


Your solution worked perfectly. Thanks very much :P

Regards
Les

 
Web mp2kmag.com
mapforums.com