Message 1 of 6
ReDim an Array Problems

Not applicable
06-17-2003
10:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to Redim an array.
I first define it as
dim arProps() as string
later in the code I redim it as
ReDim Preserve arProps(0 To ListBox1.ListCount, 0 To 1)
where ListBox1.Listcount is usually around 25 to 35
however I only end up putting in one row of info
now later in the code I want to strip out the extra blank cells so I redim
to
ReDim Preserve arProps(0 To EmptyArraySpot, 0 To 1)
where the first time around EmptyArraySpot is 0
this is where the error occurs
I'm assuming arProps(0 to 0, 0 to 1) is illegal but why? It's simply a one
row, two column array...
ReDim Preserve arProps(EmptyArraySpot, 0 To 1) gives the same error
(subscript out of range)
--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
I first define it as
dim arProps() as string
later in the code I redim it as
ReDim Preserve arProps(0 To ListBox1.ListCount, 0 To 1)
where ListBox1.Listcount is usually around 25 to 35
however I only end up putting in one row of info
now later in the code I want to strip out the extra blank cells so I redim
to
ReDim Preserve arProps(0 To EmptyArraySpot, 0 To 1)
where the first time around EmptyArraySpot is 0
this is where the error occurs
I'm assuming arProps(0 to 0, 0 to 1) is illegal but why? It's simply a one
row, two column array...
ReDim Preserve arProps(EmptyArraySpot, 0 To 1) gives the same error
(subscript out of range)
--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------