lists and arrays in VBA

You will have to change some of your data types but the basics of what you just posted could be converted to something similar to this given the data types I used may not be accurate. Collections cannot be sorted so if you need to sort data you will probably want to use an array. … Read more

Sleep function Visual Basic

Is there a simple sleep function in Visual Basic that doens’t involve thread. Something similiar like there exists in: C: sleep(1); We also tried this code: …but it didn’t work. It gave me this error: PInvokeStackImbalance was detected Message: A call to PInvoke function ‘Ganzenbordspel!Ganzenbordspel.Spel::Sleep’ has unbalanced the stack. This is likely because the managed PInvoke … Read more

How does the “Using” statement translate from C# to VB?

Using has virtually the same syntax in VB as C#, assuming you’re using .NET 2.0 or later (which implies the VB.NET v8 compiler or later). Basically, just remove the braces and add a “End Using” You can get the full documentation here http://msdn.microsoft.com/en-us/library/htd05whh(VS.80).aspx EDIT If you’re using VS2003 or earlier you’ll need the below code. … Read more

Why is Dictionary preferred over Hashtable in C#?

For what it’s worth, a Dictionary is (conceptually) a hash table. If you meant “why do we use the Dictionary<TKey, TValue> class instead of the Hashtable class?”, then it’s an easy answer: Dictionary<TKey, TValue> is a generic type, Hashtable is not. That means you get type safety with Dictionary<TKey, TValue>, because you can’t insert any random object into it, and you don’t have to cast the … Read more