Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add a Collection to an Object
Message
De
13/07/2008 23:31:56
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01330962
Message ID:
01331015
Vues:
15
I was lost too there for awhile. I am communicating with a .net dll using its api via com interop in VFP9. In my mind, if I was instantiating an object from that dll in VFP, it would be a VFP object and only VFP commands to interact with the object would work. That's why I thought a collection with 3 items would be accessed as item[1], item[2], and item[3]. Not true, the remove property and add property methods are the ones defined in dotnet belonging to the object and referencing the items in the collection starts with item[0] (just like arrays in dotnet are zero based it seems collections are as well)...

>You lost me here.
>
>>Another strange thing, and it threw me for awhile: Stepping through items in the collection (this is in VFP9), to access the first item, I can only see it using: mycollection.item[0] ! the same as in dotnet. Strange... I figured that would blow up in VFP... I only tried item[0] (as a fluke) after the item count was 2 but item[2] blew up yet when I checked the value in item[1] it was the 2nd item in the collection... It is a net component instantiated in VFP9 via com, but I really didn't know about this until now...
>>
>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform