Mirage Source

Free ORPG making software.
It is currently Fri Mar 29, 2024 1:11 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Dynamic Arrays
PostPosted: Thu Oct 01, 2009 3:48 am 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
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.


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Thu Oct 01, 2009 4:07 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
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)

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 3:52 am 
Offline
Regular
User avatar

Joined: Sun Jun 01, 2008 8:39 pm
Posts: 91
That's really confusing how VB6 arrays start from one and not zero =/


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 4:53 am 
Offline
Regular

Joined: Wed Dec 20, 2006 8:31 pm
Posts: 50
Location: Smyrna, Delaware
VB6 arrays do start from zero. They only start from a different value if specified.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 5:51 am 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Aaron wrote:
VB6 arrays do start from zero. They only start from a different value if specified.


Yupp.


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 6:30 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
I prefer to start my arrays at 2.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 7:26 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 07, 2009 3:17 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
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.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 14, 2009 5:33 pm 
Offline
Knowledgeable
User avatar

Joined: Fri Feb 02, 2007 4:50 am
Posts: 263
Location: usa michigan centriville
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)

_________________
Fuck? I really joined in 2006.
Spirea, Chat Rooms, Discussions, Help. everything you need in one spot.
http://spirean.com
I love my computer, you never ask for more, you can be my princess or be my whore


Top
 Profile  
 
 Post subject: Re: Dynamic Arrays
PostPosted: Wed Oct 14, 2009 8:06 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
Yeah.

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

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group