Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Delphi equivalent of VB's "Dim myExampleArray(4, 2)&quo 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 |
| |||
|
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. |
![]() |
| Tags |
| 2&quo, myexamplearray4 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |