Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conversion from C# to VB.NET
Message
De
19/04/2013 09:06:21
 
 
À
19/04/2013 08:56:27
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01571173
Message ID:
01571471
Vues:
40
>>>>Interesting. It's cleverer than I thought. But :
        static void TestWithForEach()
>>>        {
>>>             int l = Tables.Length;
>>>            ReInitializeTables();
>>>            Console.WriteLine(Tables[l]);
>>>
>>>            Console.ReadLine();
>>>        }
>>
>>
>>Would fail - even without ReInitializeTables()
>
>Duh. OK : Console.WriteLine(Tables[l-1]);
>
>>Bear in mind that Michel stores a refernce of App.oApp.Tables in another object oProcess and continues working with that reference. When App.oApp.Tables is replaced by a new occurrence - oProcess continues to use the previous object
>
>That's what I don't get.
>oProcess.Tables = App.oApp.Tables;
>It's still a reference. If you change App.oApp.Tables then you change oProcess.Tables ?


No - but he doesn't change Tables once it's been initialized - it contains lookup data - a bit like a table Countries

Once in a while a country is added - so Countries is reinstantiated and reinitialized - then assigned to App.oApp.Countries


Now - App.oApp.Countries contains one more entry than oProcess.Countries - which is the previous instance
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform