Page 1 of 1

Resetting Array Data?

Posted: Tue Nov 08, 2005 12:58 am
by Rocket Boy
Okay, I'm programming a GUI and I want to make a routine for closing a window that would reset all it's array data like it never existed. This way it could be taken the place of by a new window. How could I do this?

Posted: Tue Nov 08, 2005 3:55 am
by matt2jones
Try looking up ERASE or REDIM commands....

Failing that, do it by hand...

matt

Posted: Tue Nov 08, 2005 7:45 am
by Nodtveidt
ERASE works wonders for static arrays but it destroys dynamic ones. The best idea is probably to clear the array manually.

Posted: Tue Nov 08, 2005 10:08 am
by Rocket Boy
You mean just setting all it's parts to 0?

Posted: Tue Nov 08, 2005 11:00 am
by matt2jones
Yup...

Or if your using a TYPE, it might be faster to poke through the whole array space in a loop... less typing...

matt

Posted: Tue Nov 08, 2005 5:00 pm
by Rocket Boy
Cool. On a not totaly related note, but probably not worth starting another thread over... I have some code for inputting text into a window that basically goes

<sort-of pseudo code>
do
a$ = INKEY$
font routine, a$, x, y, ect...
loop until the user clicks something else
</sort-of pseudo code>

Now, if I dont have any text boxes selected but I just type a bunch of crap in... it will end up going into the next text box I select, why is that? I dont want any key hits that happen when no text box is selected to go into anything.