Jump to content
  • Advertisement
Sign in to follow this  
guyaton

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

This topic is 4598 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
Advertisement
Use System.Collections.ArrayList. There are also various other useful containers in that namespace.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!