VB6.0 to newbie C#

M

Michael Harrington

Is there a C# equivalent to Vb6's Erase when dealing with arrays?
Also vb6 handles the long variable type better (speedwise) than int.
Is this also the case in C#?
TIA Mick.
 
A

Alberto Poblacion

Michael Harrington said:
Is there a C# equivalent to Vb6's Erase when dealing with arrays?

If I remember correctly, VB6 Erase removed all elements of an array and
left the array with length zero. In C#, you could achieve a similar effect
by assigning a new array with zero elements:

string[] theArray = ...;
....
theArray = new string[0];

Or, if you don't need to use it as a referece, just set it to null:

theArray = null;
Also vb6 handles the long variable type better (speedwise) than int.
Is this also the case in C#?

In C# the int type is 32-bits wide, therefore it is equivalent to the
Long type in VB6. The old Integer in VB6 (16-bits) would be a "short" in C#.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top