Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy VFP Array to Excel
Message
De
09/12/2005 17:09:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01076673
Message ID:
01076772
Vues:
29
Yuri,
I don't see that as a bug. If I wanted to see it that way than under the covers there are more that could be accepted as a bug. That's the cost you pay with single dimension arrays. It in fact looks like:

dimension aSingle[1,nelems]

ie:
dimension aTest[2]
aTest[1] = 1
aTest[2] = 2
? aTest[1,1]
? aTest[1,2]
? aTest[1,3] && error
? aTest[25,1]
Cetin

>Cetin,
>
>Yes, I understand that VFP works this way, but why? It look like a bug to me:
>
>
>dimension a1[200]
>dimension a2[200,1]
>
>One may then ask, how many columns there are in a1 and in a2?
>
>?Alen(a1,2)  && returns 0   ??
>?alen(a2,2)  && returns 1
>
>
>
>
>>
>>Yuri,
>>I think it's the way VFP works. Result would be the same if you appended tmp_array2 to a cursor (single row). So in effect excel sees it:
>>.Range(...).Cells.Value = 'ConstantValue'
>>
>>Whenever I work with append from or excel copy I redimension the array like this:
>>
>>Dimension tmp_array2[Alen(tmp_array2,1),Max(1,Alen(tmp_array2,2))]
>>
>>PS: To be more clear to Excel it's on a single row (single row, 200 columns):
>>.Cells(1,1),.cells(1,Alen(tmp_array2,1)).Value = ...
>>
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform