What is required in Delphi 2007 to use Variant arrays?

723 views Asked by At

I'm a newbie in Delphi, using Delphi 2007. I am learning things related to COM programming, in order to make a basic plugin to a program called Retail Pro. I have a little of background in .NET (C#, ASP), NetBeans (Java, JSF) and PHP.

Anyway, I'm following this intro tutorial to COM Programming :

An Introduction to COM Programming with Delphi

At second and third parts of the 5th lesson about Variant Arrays, there are sample codes to download. Here is the sample code of second part:

http://delphi.about.com/library/weekly/code/src122104_sample.zip

When I compile the code, it gives me a lot of errors of undeclared identifier (VarType, VarArrayCreate, VarArrayLowBound, etc). Is there some class to add in the uses section in order to be able to compile this piece of code?

1

There are 1 answers

1
David Heffernan On BEST ANSWER

The code is missing a unit from the uses clause. That unit is named Variants and contains all the symbols that the compiler cannot find. Add that unit and the code will compile.