|
-
Jan 29th, 2004, 05:16 AM
#1
Thread Starter
Addicted Member
redim question
when i do a redim of an array, to raise the size, what happen with the data containing in the array, it loses?
i have an array based on the data from my DB, and i want to do a methode that verifys if there are new data, and if it have something, add to the array.
if some data is deleted i won´t lower the size, i just won´t use that object of the array anymore.
Thank you,
Guilherme Costa
-
Jan 29th, 2004, 06:27 AM
#2
Adds an extra space on the end of an array
Code:
Redim Preserve MyArray(ubound(MyArray)+1)
You can use dataset objects in .Net, but if you want a simple storage place then look into using a collection instead, its more flexible and quick to access if you use keys.
-
Jan 29th, 2004, 06:28 AM
#3
PowerPoster
Hi,
The following statement resizes the array but saves the contents of the elements.
ReDim Preserve MyArray(15) ' Resize to 16 elements.
Full details in the microsoft vb.net help files under "Redim"
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|