Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conversion from C# to VB.NET
Message
De
20/04/2013 05:42:00
 
 
À
20/04/2013 04:20:46
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:
01571525
Vues:
45
>>Let me give an example of what is happening.
>>
>>Array.Resize() returns another object - the original array continues to exist for as long as it is referenced
>>
>>
>>	public class AClass
>>	{
>>		public static string[] Tables = { "one", "two", "three" };
>>
>>		public static void Main()
>>		{
>>			string[] tables = Tables;
>>
>>			Array.Resize<string>(ref Tables, 10);
>>
>>			Console.WriteLine("previous version contains {0} elements", tables.Length);  // 3
>>			Console.WriteLine("newer version contains {0} elements", Tables.Length);  //10
>>			Console.ReadLine();
>>		}
>>
>>	}
>>
>Got it (finally) :-}
>I'd somehow got it into my head that Michel was always using oProcess.oApp.Tables rather than grabbing a reference to oApp.Tables itself.....


For a moment I thought you were pulling my leg

I got the picture when
(1) null reference exception
must have been something like
in App

Tables = null
// here oProcess on another thread grabs a reference to Tables
Tables = new TablesClass()
Tables.Initilaize()
(2) Then there was the story about cloning - trying to get the state of Tables at a specific moment, so that later changes would be invisible to oProcess
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform