Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

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 Desktop 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 ...

  1. #1
    schuchhardp is offline 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

  2. #2
    Jack is offline 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.

  3. #3
    schuchhardp is offline Junior Member White Belt
    Join Date
    Nov 2002
    Posts
    10

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. looking for Delphi solution for the "Server Busy"
    By schuchhardp in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 10-20-2008, 04:04 AM
  2. Error "overflow execution stack" while readinq a
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-18-2005, 01:47 PM
  3. Mapppoint 2003 EULA vs "Fleet Applications"
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 04-17-2004, 02:03 PM
  4. Do I need "Autoroute Europe", if I install "M
    By bigtail in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-23-2004, 11:58 PM
  5. Export "Find nearby places" along a route?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-06-2003, 09:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83