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 Professional Discussion / Bunni's back again :) With a question!

Author
Message
Bunni
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: United Kingdom
Posted: 27th Jul 2003 21:12
Hiya guyz

Sum of u may remember me I was here a while back - soz I dissapeared, I tht it was probably safer as I seemed to be distracting ppl

Anyhew I have carried on programming in DarkBasicPro in my spare time, and have come up with a problem - Is there ne command to wipe all values @ once? By this I mean Clear all variables, all strings, all array data, all media loaded - Kinda like gettin the prog to reset, but you could specify a goto afterwards to start the prog wherever u wanted?

Surely there must be a kinda memory flush or something possible?

Thanx guys luv Bunni
Yes, a GIRL who can really program! Not bad looking too hehee
Mnemonix
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 27th Jul 2003 21:30
There is a command called Flush video memory but that only refreshed video memory. It does not remove all the media in use
although for that a simple function can be devised but as for variables i cannot help u there

"We are getting aggravated"
"Yes, we are"
Shock
AGK Developer
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: United Kingdom
Posted: 27th Jul 2003 21:59
hmm, could be usefull. If there isn't one, they should put it in pacth 6

...::::ShockForge::::...
Danmatsuma
23
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 28th Jul 2003 02:06 Edited at: 28th Jul 2003 02:08
You'd have to make your own function something like this:




and then also for each array

undim arrayname(*,*,*)

however I'm not sure you can do much about deleting the variables besides make them equal 0...

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 28th Jul 2003 06:52
unfortunately there is no way to unregister values once their registered without redeclaring them all local within a function.
perhaps if you explained what your trying to achieve exactly we could be of more help.

but really if you wanted to do something like this you'd have to manually do it i'm afraid.

Bunni
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: United Kingdom
Posted: 28th Jul 2003 19:18
Thanx guys I tht itd b easier than this

Basically I wanted 2 have a restart in my program, + also a clean skip2. If I did it manually I'd have 2 find every single lil value + declare em as 0 or "" @ the beginning - + what with my random programming style thats a whole loada lil variables hehe

Oh well I guess I'm gonna hav 2 stop bein so lazy...

Yes, a GIRL who can really program! Not bad looking too hehee
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 28th Jul 2003 19:23 Edited at: 28th Jul 2003 19:27
why not just restart the program without cleaning them...
i mean if you think about it, unless its a value that needs to start out as 0 and you're not filling it then just like loop to where you reenter all the data

then you only have to put all the NULL values into redeclaring

[edit-]
you could always use #CONSTANTs and put ALL of your data into an array

so like dim dwARR(0) as dword ... and then when you declare a new value you just array insert at bottom

#constant MyVala 1
#constant MyValb 2

dim dwARR(0) as dword

array insert at bottom dwARR(0) : dwARR(MyVala) = 10
array insert at bottom dwARR(0) : dwARR(MyValb) = 20

something like that... then all you have to do is undim a matter or 6 or 7 arrays

Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 28th Jul 2003 21:05
If you want to reset your variable space and you dont want to go through all your variables by hand try this.



What this is doing is starting a new instance of your game and quitting the old one so that all media and variables are reset - then using the command line to tell your program where to jump too.

Failing that you can clear all media with a routine similar too:



However this would require you to reset all of your variables by hand.

Pneumatic Dryll
D Man
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 28th Jul 2003 21:13
Could be made more easier in DBPro by simply changing the display mode e.g. set display mode screen width(),screen height(),screen depth().
This works only for media(objects,images,etc...) not for arrays or variables.

God is real, unless declared integer.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th Jul 2003 00:30


I would've thought, even with a hundred variables, it would be quicker to write a gosub to reset them rather than come onto this forum and ask for a shortcut!

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 29th Jul 2003 07:27
personally in C++ when i keep variable i like to declare them all in a single function for each aspect of what i'm doing...

so like my media would be initiated in one function, audio variables in another etc... unfortunately DBP has a destinct lack of being able to do this.

---

dman just doing "flush video" does the same effect as changing display mode - and she want the variables to be redeclared and reregistered.

as i've said you can either long hand everything or you can just throw them all into expandable arrays.

Login to post a reply

Server time is: 2026-07-23 02:36:55
Your offset time is: 2026-07-23 02:36:55