Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / tutorial on Arrays

Author
Message
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 3rd Nov 2006 17:09
hello everybody i have seen so many posts on Arrays and i think i found out a way for people to understand it.


Ok in that code snippet you will recognize dim that is to make an array then i used the for statement i made 10 arrays you can also store things in arrays this just prints all the arrays on the screen not whats in them

I hope this helps

game creator
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Nov 2006 18:45
That code only makes the array, it doesn't use it...

This is how an array works:



whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 3rd Nov 2006 23:17
hmmm yours is ok but mine is a little bit more understanding

game creator
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Nov 2006 01:16


First of all, you're dimming the array in the loop, which you shouldn't. Second, you're not using it... you just made it and then go onto something completelly different.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Nov 2006 01:37
I guess your trying to help whipped but zotoaster does have valid points, your code does not actually do as you say. here is an example to clear it all up.





Dbproguy
17
Years of Service
User Offline
Joined: 1st Nov 2006
Location: At my computer desk no-life programming
Posted: 4th Nov 2006 01:44
Firstly, when you make the array in the loop, you keep making it and it slows down the computer (I ran the program and watched my free memory go from 50mb all the way down to 0mb and my computer froze) so thats one thing down and then second, you made an array but didn't show how to use it, (Zotoaster mentioned both of those basically) and also the for loop and whats in it has nothing to do with the array.

Quote: "this just prints all the arrays on the screen not whats in them "


nope, it just prints whatever number t is. There is only 1 array and it's completely empty.

I'm such a n00b (Dark Basic Pro Guy is my older bro btw!!!)
[/url]
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 5th Nov 2006 00:31

Login to post a reply

Server time is: 2024-09-25 11:25:06
Your offset time is: 2024-09-25 11:25:06