Re: Increment a Variable?
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Jul 2005 12:55:14 -0400
"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B8BC07DC-BC5F-4BE6-A2ED-B229075B6C74@xxxxxxxxxxxxx
> Or:
> Dim MyArray(100) As Variant ' or as a specific type
> Dim I As Integer
>
> Do While <some condition>
>
> If I >= UBound(MyArray) Then
> Redim MyArray(I+1) Preserve
> End If
> I = I + 1
> MyArray(I) = <some value>
>
> Loop
<g> I thought of that, but didn't want to get too deep. I believe,
though, that for your version to work, you have to change this:
> Dim MyArray(100) As Variant
to this:
Dim MyArray() As Variant
' ...
ReDim MyArray(100) ' maybe a good starting size
or just this:
ReDim MyArray(100) ' to start with
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- Follow-Ups:
- Re: Increment a Variable?
- From: Klatuu
- Re: Increment a Variable?
- References:
- Increment a Variable?
- From: G
- Re: Increment a Variable?
- From: Klatuu
- Increment a Variable?
- Prev by Date: Re: Application.SetOption fails even though copied from help
- Next by Date: Re: Application.SetOption fails even though copied from help
- Previous by thread: Re: Increment a Variable?
- Next by thread: Re: Increment a Variable?
- Index(es):
Relevant Pages
|
Loading