Expandable vectors?

# Thread: Expandable vectors?

1. David P Guest

## Expandable vectors?

Is there a way to expand a vecor (array)? For example if I have a vector with 3 values and I want to add another value (as number 4), how do i do? It must be possible.

2. Senior Member
Join Date
Dec 1969
Posts
898

## RE: Expandable vectors?

dim myArr()<BR><BR>Redim myArr(3)<BR>myArr(0) = 1<BR>myArr(1) = 2<BR>myArr(2) = 3<BR><BR>redim Preserve myArr(3)<BR>myArr(3) = 4

3. David P Guest

## RE: Expandable vectors?

Isn&#039;t there a way to just add another value, without knowing the number of values?

4. David P Guest

## RE: Expandable vectors?

Isn&#039;t there a way to just add another value, without knowing the number of values?

5. Senior Member
Join Date
Dec 1969
Posts
898

## RE: Expandable vectors?

myNum = ubound(myArr)<BR>Redim preserve myArr(myNum+1)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•