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 / I need help removing my variables

Author
Message
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 30th Dec 2003 12:30
Ok. Perhaps I should put this in the newcommers section but I´m using DBC so I´ll put it here.
How do I remove variables that I no longer need? For example. If I had a menu that gets removed from memory when the main game starts. How do I get rid of the variables that go with it? As far as I can tell there´s no way of removing them.
Thanks your help
MIR
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Dec 2003 12:46
You are right, there isn't a way to remove them, but, you CAN remove array's.

so, if you had an array that held all your variables etc, and you no longer needed it, you'd use the UnDim command. Which erases the array from memory.

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 30th Dec 2003 13:02
Wow, that was quick. I normaly have to wait a day or so.
I can´t use arrays as I´ve already finished the code for the main game. I´m working on the menu, single player, optimizing, saving and loading now.
Thanks for your help. I´ll use arrays in the sequel. Along with funtions and dlls and all the other things that a sequel demands.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Dec 2003 13:39
lol, ok...

What you can do, is simply set all the variables to 0, that way, you are taking up less memory than if they were holding values such as 500 etc...

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 30th Dec 2003 13:51
That´s a good idea. I´ll do that for now then.

Yep, you´ve helped...

Login to post a reply

Server time is: 2025-05-22 09:00:52
Your offset time is: 2025-05-22 09:00:52