Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add to end of Array

Status
Not open for further replies.

GerardMcL

Technical User
Aug 5, 2004
212
IE
Hi,

I have a function that reads a file and extracts the data (recipes), current file has 3, and in turn adds each recipe to the database.
I was hoping that once this has finished that the User would recive a message saying e.g.
Recipes Added:
0001 - Recipe01
0002 - Recipe02
0003 - Recipe03

What I wanted to know was can I add these to the END of an array, I cant specify which position, so can I do this.
Array is recipes_added()

 
Yes,

You would start by creating the array;

Dim recipes_added()

To initialize the array with one item;

ReDim Recipes_Added(0)

To added to the array;

ReDim Preserve Recipes_Added(UBound(Recipes_Added)+1)
 
This is what MS proudly calls a "Dynamic Array"!

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top