Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection behavior when adding a new item
Message
De
25/07/2006 05:09:45
 
 
À
24/07/2006 12:06:19
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01138855
Message ID:
01139600
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform