Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection behavior when adding a new item
Message
From
25/07/2006 05:09:45
 
 
To
24/07/2006 12:06:19
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01138855
Message ID:
01139600
Views:
10
Hi,

Saw your subsequent post. So:

>Well, if I have 20 conditions to add, is there a way to have one declaration for the object and reuse it? Basically, is there a way to clear its content before reassiging it again?

No. Since your collection is storing a reference to the object array you'd need to create a new one for each item in the collection - basically what you're Redim is doing now. I'd do something like this instead (sorry, C#):
System.Collections.ArrayList ODropDownCondition = new System.Collections.ArrayList();

ODropDownCondition.Add(new string[2] {"No DBUsers","Something"});
ODropDownCondition.Add(new string[2] {"No DBUsers2","Something"});

foreach (string[] s in ODropDownCondition)
    {
        oApp.AddJavascriptMessage(s[0]);
    }
HTH,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform