SHARED Array values with SUBs and FUNCTIONs
#9
KP, you can not resize an array that is Dim'd makes it static (= no resizable) only an array that is ReDim'd from the start maybe resized because made Dynamic from the start.

This is without the use of Static$ or Dynamic$ metacommands that I never use.

So how to you start a Dynamic array without the Dynamic$ metacommand? Update: Answered nice!

"When the $DYNAMIC metacommand or REDIM is used, array element sizes are changeable (not $STATIC)." from Wiki Dim

Update:
OK so you can make an array dynamic with variable dimensions, nice, here is anther way:
Code: (Select All)
Dim As Integer rows, cols

rows = 10
cols = 12
Dim grid(row, cols) 'Dynamic array

ReDim grid(14, 10)

' OK   that's one way


' heres another

rows = 10
cols = 12
ReDim grid2(row, cols) 'Dynamic array

ReDim grid2(14, 10)

If you ReDim the array from the start, you know it's Dynamic from the start.
b = b + ...
Reply


Messages In This Thread
RE: SHARED Array values with SUBs and FUNCTIONs - by bplus - 06-22-2023, 05:51 PM



Users browsing this thread: 4 Guest(s)