Posted: 2nd Sep 2011 6:19
I'm trying to destroy an array, but am getting an unknown command error on the undim statement when executing. I also noticed it didnt turn that pretty blue that the known commands do when I entered it.

DIM myList[10]
myList[1] = 33
UNDIM myList[]

I haven't found anyone else posting about this (at least via search).

Am I entering something incorrectly or is this an existing issue?

Thanks.
Posted: 2nd Sep 2011 8:34
I did already post about it here but I'm not sure a search would have turned it up.
Posted: 2nd Sep 2011 11:37
Not certain that UNDIM is in the language. I'm pretty sure you can use REDIM or simply declare the array again when you want to wipe it.
Posted: 2nd Sep 2011 11:49
Not certain that UNDIM is in the language.

Docs say that is: http://www.appgamekit.com/documentation/language/6_undim.htm

I'm pretty sure you can use REDIM or simply declare the array again when you want to wipe it.


There is no reference to REDIM in the docs, but equally I haven't tried to use it (or tried to redeclare the array).
Posted: 2nd Sep 2011 20:48
@ Rich - I missed your post. Glad I wasnt the only one who noticed.

REDIM doesnt work and Bursar is correct that UNDIM is referenced in the documentation. Redeclaring the array works w/o a problem. I'll just use that. The documentation should probably be updated.

Thanks for everyone's help.
Posted: 3rd Sep 2011 17:07
Ok, I take back what I said about redeclaring the array working to wipe it out. I can redeclare it, but all the values in the array stick. For my purposes I can loop through the array and set every value to 0.

It would be nice to have a command that would blow the array away completely. Maybe the UNDIM command can be added.