MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Delphi equivalent of VB's "Dim myExampleArray(4, 2)&quo

This is a discussion on Delphi equivalent of VB's "Dim myExampleArray(4, 2)&quo within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; The Datasets.importData method takes as second argument an ArrayOfFields. In the VB example at the MP2002 help page this variable ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-2003
Junior Member
White Belt
 
Join Date: Nov 2002
Posts: 10
Delphi equivalent of VB's "Dim myExampleArray(4, 2)&quo

The Datasets.importData method takes as second argument an ArrayOfFields. In the VB example at the MP2002 help page this variable is declared as
Dim myExampleArray(4, 2)

I'm trying to achieve the same in Delphi 6 but without much success. I've tried:
var
reportFormat: array of array of OleVariant;
begin
setLength(reportFormat,5);
setLength(reportFormat[0],2);
as well as:
var
reportFormat: Variant;
begin
reportFormat:=VarArrayCreate([0,4], VarArray);
reportFormat[0]:=VarArrayCreate([0,1], varVariant);

Does anyone know the proper construction of the necessary OleVariant?
Thanks very much,
Pascal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-19-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 8
Here´s some sample code:

var
myFilePathAndName : string;
myDataset : Dataset;
myArrayOfFields : OleVariant;

begin

fmMain.OpenDialog1.Filter := 'Ficheros Excel (*.xls)|*.XLS';
if (fmMain.OpenDialog1.Execute) then
begin

myArrayOfFields := VarArrayCreate([1, 6, 1, 2], varVariant);
myArrayOfFields[1, 1] := 'Id';
myArrayOfFields[1, 2] := geoFieldData;
myArrayOfFields[2, 1] := 'Nombre';
myArrayOfFields[2, 2] := geoFieldName;
myArrayOfFields[3, 1] := 'Dirección';
myArrayOfFields[3, 2] := geoFieldAddress1;
myArrayOfFields[4, 1] := 'Código postal';
myArrayOfFields[4, 2] := geoFieldPostal1;
myArrayOfFields[5, 1] := 'Ciudad';
myArrayOfFields[5, 2] := geoFieldCity;
myArrayOfFields[6, 1] := 'Cantidad';
myArrayOfFields[6, 2] := geoFieldData;

myFilePathAndName := fmMain.OpenDialog1.FileName;
myDataset := myMap.DataSets.ImportData (myFilePathAndName,
myArrayOfFields,
geoCountrySpain,
geoDelimiterDefault,
0);
end;
end;

Greetings, Jack.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-20-2003
Junior Member
White Belt
 
Join Date: Nov 2002
Posts: 10
Thanks Jack.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
2&quo, myexamplearray4


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
looking for Delphi solution for the "Server Busy" schuchhardp MapPoint 2006/2009 Discussion 8 10-20-2008 05:04 AM
Error "overflow execution stack" while readinq a Anonymous MapPoint 2006/2009 Discussion 5 02-18-2005 02:47 PM
Mapppoint 2003 EULA vs "Fleet Applications" Anonymous MapPoint 2006/2009 Discussion 9 04-17-2004 03:03 PM
Do I need "Autoroute Europe", if I install "M bigtail MapPoint 2006/2009 Discussion 1 03-24-2004 12:58 AM
Export "Find nearby places" along a route? Anonymous MapPoint 2006/2009 Discussion 4 11-06-2003 10:56 AM


All times are GMT -5. The time now is 12:23 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55