Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic Arrays
#1
Robin, for one, is always talking about dynamic arrays and I was wondering if somebody could shed some light on it for me. I could probably Google it I guess but thought it would be easier if I got a Mirage example/explanation. Thanks.
Reply
#2
Ummm...

Code:
DynamicArray() As DynamicArrayRec

Increase the array's size by 1:
Code:
ReDim Preserve DynamicArray(1 To UBound(DynamicArray) + 1)

Decrease by 1:
Code:
ReDim Preserve DynamicArray(1 To UBound(DynamicArray) - 1)
Reply
#3
That's really confusing how VB6 arrays start from one and not zero =/
Reply
#4
VB6 arrays do start from zero. They only start from a different value if specified.
Reply
#5
Aaron Wrote:VB6 arrays do start from zero. They only start from a different value if specified.

Yupp.
Reply
#6
I prefer to start my arrays at 2.
Reply
#7
GIAKEN Wrote:I prefer to start my arrays at 2.

You also start lunch at 9am, finishing at 3pm.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
Robin Wrote:
GIAKEN Wrote:I prefer to start my arrays at 2.

You also start lunch at 9am, finishing at 3pm.

Actually around 3pm is when I start, which is when I wake up, and normally end around midnight, where I pass out and repeat the process.
Reply
#9
isn't dynamic arrays just Normal arrays being redimed AS a bigger variable?

EXAMPLE

ReDim Map.Tile(0 To Map.MaxX, 0 To Map.MaxY)
Reply
#10
Yeah.

ReDim clears out the whole array. ReDim Preserve doesn't clear the array out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)