?
Solved

Anything like vector in VB?

Posted on 2003-03-11
4
Medium Priority
?
703 Views
Last Modified: 2013-12-25
High,

just want to ask how I can create a dynamic array (or something like this) that can dynamically expand its size?

Would you please provide some sample code to explain ?


Thanks!


cyyam
0
Comment
Question by:cyyam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:rengaraaj
ID: 8117921
redim preserve x(10) as string
0
 
LVL 1

Accepted Solution

by:
xThorx earned 80 total points
ID: 8118136
dim VECT() as string
dim VECTNUM() as long
dim VECTTEST() as long

redim VECT(10)
redim VECTNUM(10)
redim VECTTEST(5,10)
....

redim preserve VECT(15) 'add 5 more columns
redim preserve VECTNUM(20) 'add 10 more columns
redim preserve VECTTEST(5,15) 'add 5 more columns

BUT redim preserve VECTTEST(10,10) won't work cause you cannot change the first value of an array but only the last one.

Hope this help.
0
 

Author Comment

by:cyyam
ID: 8126622
Thanks both of you !

But I think xThorx has given a more detailed answer...

But I still need how to manipulate it, may I ask for your help also?

1. Can I have VECT() to be incremented dynamically without an exact size, just like vector.add() ?

2. If I have declared VECT(10) but I just fill 3 of them, then how can I do my manipulation referring to 3 but not of 10. Will the VECT() size be just 3 but not 10?

And also for delete , insert ...


Thanks a lot!

cyyam
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9053227
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept xThorx's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question