Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding and removing items in collection
Message
From
26/10/2015 14:42:14
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01626445
Message ID:
01626453
Views:
49
>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.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform