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 / Empty Array - emptys or deletes?

Author
Message
Soyuz
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 28th May 2003 15:41
A section of code will repeat many times in my app and each time I'd like to reset my array contents to 0. I thought "empty array" sounds like the right kind of command to use. But when I use it my app locks up. I have tried:

empty array MyArray()
empty array MyArray(0)
empty Array MyArray(16384)

They all have the same freeze effect on the computer.

Does this function work? Would I be better of doing:

for i = 1 to 16384
MyArray(i)=0
next i
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 28th May 2003 15:48
There seems to be problems with a few of these commands - use my linklist plug-in instead...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Soyuz
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 28th May 2003 18:02
great many goodies there - thanks, Xmas has come early!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th May 2003 07:24
Using EMPTY ARRAY is much like using UNDIM. It doesn't clear the entries, it deletes the array.

For what you want to do, this should work:

UNDIM MyArray()
DIM MyArray(16384)

Login to post a reply

Server time is: 2026-07-11 11:42:41
Your offset time is: 2026-07-11 11:42:41