Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding and removing items in collection
Message
De
26/10/2015 15:20:51
 
 
À
26/10/2015 14:42:14
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01626445
Message ID:
01626458
Vues:
33
>>I cannot explain it, I cannot even understand the code, is loObject an array? (you have loObject(1) = True)
>>
>>Anyways, if you are storing an object as the name of the variable suggests, you should not need to update the collection, what is stored in the collection is the pointer to the object, so when you modify it the collection should have the new value, for example in FoxPro (Should be the same in VB or any other OO language):
>>
>>
>>lcKey			= 'myLine'
>>loInnerJoin		= CREATEOBJECT('Collection')
>>loObject		= CREATEOBJECT('Line')
>>loObject.Left	= -11
>>
>>loInnerJoin.Add(loObject, lcKey)				&& Add the object to the collection
>>
>>loObject		= loInnerJoin.Item(lcKey)		&& Get the object from the collection
>>? 'Initial value:', loObject.Left	&& -11 as it was the value I assigned first
>>
>>loObject.Left	= 22				&& Change the value of the property
>>
>>loObject		= loInnerJoin.Item(lcKey)		&& Get the object from the collection again
>>? 'Updated value', loObject.Left	&& -22 as the object is the one that has been changed
>>
>>
>>
>
>This is so simple. I never thought of it.
>
>Thanks, this is working.

Wow!! I actually got one right ;-)
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform