[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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