Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection behavior when adding a new item
Message
From
22/07/2006 19:45:22
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Collection behavior when adding a new item
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01138855
Message ID:
01138855
Views:
64
I am trying to understand something in regards to adding a new item in a collection. I have this code:
        Dim loCondition(2) As Object

        loCondition(1) = "NoDBUsers"
        loCondition(2) = "Something"
        oDropDownCondition.Add(loCondition)

        For Each loCondition In oDropDownCondition
            oApp.AddJavascriptMessage(loCondition(1))
        Next

        loCondition(1) = "NoDBUsers2"
        loCondition(2) = "Something"
        oDropDownCondition.Add(loCondition)

        For Each loCondition In oDropDownCondition
            oApp.AddJavascriptMessage(loCondition(1))
        Next
On the first For Each, I have a message "NoDBUsers", which is normal because I only have one item inserted in the collection. But, on the second For Each, I have two messages, which is normal because I added an additional item in the collection, but both messages are "NoDBUsers2". I just cannot understand this behavior. Can someone explain me why I do not obtain "NoDBUsers" followed by "NoDBUsers2"?
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
Next
Reply
Map
View

Click here to load this message in the networking platform