Qbasicnews.com

Full Version: Reset all arrays and variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to reset all arrays so that I am able to re dim them? I know that there is a redim function, but I would prefere to just to get rid of them entirely, and re do them

If I could dump all the variables, that would be neat too, but not very important.


Thanks in advance :-)
See CLEAR.
CLEAR is a bit of an overkill, isn't it? Can't someone make an UNSET function? (prolly impossible, but...)
How is it overkill? It does exactly what he asked for.
Well... I dunno, it's like you do a CLEAR and it just goes through mem pokeing zeroes... and I don't get why you'd want to kill every single var in a program anyway, unless right at the very start to set some more stack...

Quote:Is there a way to reset all arrays so that I am able to re dim them? I know that there is a redim function, but I would prefere to just to get rid of them entirely, and re do them

This smells like you want to change the size of an array while preserving the values in it... am I right?

Silent-Death

I like this
Code:
ERASE array
For eraseing everything in the array...
kill all the data, make it seem like the entire program is starting new again
If you just want to start the program over you can use RUN in the main module.
.. or CLEAR...
can you do this then?

dim abc(20)
clear
dim abc(25)

not that I need to do that, but I think it would be very usefull in my new project