It looks like DynArrayFromVariant is trying to put the varient vMatches into an existing dynamic array, but you haven't allocated any memory for your array of integer.
You have created an integer array variable but it doesn't have any memory allocated for its data.
 
HTH
 
Regards
Paul McKenzie
Analyst Programmer
SMSS ltd.
 
----- Original Message -----
Sent: Thursday, January 09, 2003 4:13 PM
Subject: [DUG]: [Q] Using DynArrayFromVariant....

G'Day,

I have the following:

type
TMatchesArray = array of integer;
var
daMatches : TMatchesArray;
vMatches : Variant;

I assign a value to vMatche which the debugger tells me is a Variant array of integer. Now I want to convert vMatches to daMatches and for this I can use the

DynArrayFromVariant(Pointer(daMatches), vMatches, TypeInfo(Variant));

However it blows up with an AV. Can anyone tell me what I am doing wrong here?

TIA

-- Donovan
----------------------------------------------------------------------
Donovan J. Edye [
www.edye.wattle.id.au]
Namadgi Systems [
www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [
http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------

Reply via email to