Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use DynArrayToVariant

167 views
Skip to first unread message

Mandar

unread,
Dec 21, 2001, 1:15:18 PM12/21/01
to

Hi
I want to convert the dynamic array to variant so using the function DynArrayToVariant.
I am not understanding how to pass the last two arguments.One pointer to array and second is typeinfo pointer.
Actual example will be of lot of help.I had already gone through through delphi documentation.

Mandar

Rudy Velthuis (TeamB)

unread,
Dec 21, 2001, 1:37:25 PM12/21/01
to
In article <3c237c36$1_2@dnews>, Mandar says...

> I want to convert the dynamic array to variant so using the function DynArrayToVariant.
> I am not understanding how to pass the last two arguments.One pointer to array and second is typeinfo pointer.
> Actual example will be of lot of help.I had already gone through through delphi documentation.

type
TDoubleArray = array of Double; // a type def is required
// to be able to use TypeInfo
var
V: Variant;
D: TDoubleArray; // this is a pointer already!

begin
SetLength(D, 30);
// fill D with something useful.
DynArrayToVariant(V, D, TypeInfo(TDoubleArray));

--
Rudy Velthuis (TeamB)

"Beware of bugs in the above code; I have only proven it correct, not
tried it." -- Donald E. Knuth.

0 new messages