• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

redim

Hi,

Please kindly assist how can we increment allocation of X coodinate?

i.e.

Dim Arr_O(0, 4) As Integer
ReDim Preserve Arr_O(increament by 1, no change)


ReDim Preserve Arr_O(UBound(?)+1, no change)

Thanks
0
RyanBank
Asked:
RyanBank
  • 6
  • 3
  • 2
2 Solutions
 
EDDYKTCommented:
you cannot, you can only redim the last dimension of a dynamic array
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I agree with EDDYKT
0
 
RyanBankAuthor Commented:
EDDYKT,

would you happen to know how we can redim the last diremtion? using the last value.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
RyanBankAuthor Commented:
Dim Arr_O(4, 0) As Integer
ReDim Preserve Arr_O( no change,increament by 1)


ReDim Preserve Arr_O(no change,UBound(?)+1)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:


ReDim Preserve Arr_O(lbound(arr_o,0) to ubound(arr_o,0), lbound(arr_o,1) to UBound(arr_o,1) + 1)
0
 
EDDYKTCommented:
You can reverse your array looks like

ie


Dim Arr_O(0, 4) As Integer

to

Dim Arr_O

ReDim Arr_O(4, 0)

ReDim Preserve Arr_O(4, 2)
ReDim Preserve Arr_O(4, UBound(Arr_O, 2) + 1)

0
 
RyanBankAuthor Commented:
EDDYKT,

if we didn't know the last value of the last dimension, how can we pull it up?
0
 
RyanBankAuthor Commented:
ReDim Preserve Arr_O(4, Ubound(?) +1)   what will the ? be
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please check my comment above
0
 
RyanBankAuthor Commented:
error returned: array laready dimentioned.
0
 
RyanBankAuthor Commented:
got it using EDDYKT's solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now