A few quickies on Arrays

# Thread: A few quickies on Arrays

1. Senior Member
Join Date
Dec 1969
Posts
511

## A few quickies on Arrays

1) How do I do a count of the amount of items in an array.<BR><BR>2) How do it do the equivalant of While Not MyRS.EOF for an array<BR><BR>3) Ubound is the upper limit for an array, (i think) and (lbound) is the lower limt. Whats the command to set these and do they have to be set or can the size be dynamic<BR><BR>4) do you have to do SET MyArray - Nothing like you do with recordsets?<BR><BR>5) Last one If I have an array of say two items (item1,Item2) how would i create a seperate array with item1 without destroying the data on item2<BR><BR>Your help is appreciated.

2. Senior Member
Join Date
Dec 1969
Posts
2,854

## RE: A few quickies on Arrays

1) How do I do a count of the amount of items in an array. <BR>&#062;&#062; UBound(arrayName, [optional]dimension)<BR><BR>2) How do it do the equivalant of While Not MyRS.EOF for an array <BR><BR>For i =0 to Ubound(aryName)<BR>....<BR>Next<BR><BR>3) Ubound is the upper limit for an array, (i think) and (lbound) is the lower limt. Whats the command to set these and do they have to be set or can the size be dynamic<BR>&#062;&#062;The size can be dynamic, but it depends on how you declare the array. You cabn also resize the array. Check the docs.....<BR><BR>4) do you have to do SET MyArray - Nothing like you do with recordsets? <BR>&#062;&#062; No. Use...<BR><BR>Dim MyArray<BR>ReDim myArray(size)<BR><BR>5) Last one If I have an array of say two items (item1,Item2) how would i create a seperate array with item1 without destroying the data on item2<BR><BR>Well, If it was just Item 1 you wouldn&#039;t need an Array, just a variable..<BR>Dim myVar:myVar=myArray(0) &#039;for Item 1<BR>if more than 1 Item<BR><BR>Dim array2<BR>array2 = array1<BR>Redim Preserve array2(10) &#039; to keep the first ten Items in the array.<BR><BR>HTH.<BR>D.<BR>

3. Senior Member
Join Date
Dec 1969
Posts
511

## Thanks that helps - spot on.

..

#### Posting Permissions

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