Sign in to follow this  

I'm not a VB.NET programmer........ arrays?

This topic is 4383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In VB.NET (2003) is there a way to create non-static size arrays such as the C++ STL equivalent ( std::vector ) that will automatically allocate/reallocate based on the number of items i'm adding into the array. thanks in advance, ~guyaton

Share this post


Link to post
Share on other sites
You should be able to ReDim an existing array. Alternately you can use one of the container classes like System.Collections.ArrayList.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
(coming from vb6, not sure if its applicable)

dim arr()

redim arr(somenumber)

Also coming from vb6, you can have variant to int/string/whatever functions. (good as redim only takes ints/doubles/singles iirc.)

ie.

public function toint(x) as integer
dim i as integer
i = x
toint = i
end function


Which then lets you just use random variable names without declaring (which is a lot nicer).

Share this post


Link to post
Share on other sites

This topic is 4383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this