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.

DarkBASIC Discussion / Noobish undim question

Author
Message
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 2nd Oct 2008 07:34 Edited at: 16th Jan 2012 10:26
Ok I'm still not sure how to use this am I supose to; after using dim x(100), do an undim x(0) or an undim x(100) and also what if im using multidimension?

Attachments

Login to view attachments
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Oct 2008 09:09
I have been programming with DarkBASIC for a little more than 4 years, and that is a very good question, because I also do not know...

But I undim a dimension the same way I dim a dimension:



Suicide is away of telling God, You can’t fire me I quit !!!!!
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Oct 2008 22:24
I've used this syntax in DBC and it worked ok for me:

dim stuff(100,3)
undim stuff(100,3)


Technically, WindowsKiller is right in that you shouldn't need to specify the size of the array.


Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 2nd Oct 2008 22:29 Edited at: 16th Jan 2012 10:26
Hmm so either way works right? I've crashed a few times while testing my codes over and over, is the a result of not enough memory cause I didn't clear them out properly? It's why I wanted to know the correct usage of undim.

Attachments

Login to view attachments
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 3rd Oct 2008 06:02
Why would you want to delete an array? They aren't like memblocks; they don't take up a lot of space. The only reason I would undim something is if I am desperate to move up a framerate, but I don't think it affects that at all.


"I reveal my trap card, GEORGE DUBYA BUSH!
America loses 2000 Life Points! America loses." -Deucalion2
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Oct 2008 09:39
Its not always to free memory, maybe he needs to repopulate an array with an unknown size of elements? I had to for a file scan program.


Login to post a reply

Server time is: 2025-06-07 08:02:46
Your offset time is: 2025-06-07 08:02:46