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.

AppGameKit Classic Chat / Array Commands

Author
Message
XanthorXIII
AGK Gold Backer
13
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 15th Aug 2011 16:53
Are there any commands for re-sizing an Array or deleting items from an array? If DIM and UNDIM are the only two available, I may have to come up with my own functions to handle resizing but if something is already there to handle it that would be great.
If there is nothing, I would still recommend these functions.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 16:56
Undim is currently not available.

The only option at the moment is to do something like this:

DIM array [ 100 ]

DIM array [ 10 ]

The second declaration will allow you to replace the larger array with a smaller one. The first array will be deleted and wiped.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 17:00
A small example showing how this might work:

XanthorXIII
AGK Gold Backer
13
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 15th Aug 2011 18:32
Will DIM array[0] completely remove the contents of the array freeing up that memory?
I would like to have some clean up routine at the end of each play session.
I know you're probably working on the additions memory management which is why I really suggest the additions of the other functions.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 18:54
Yes, it will free the array.

Login to post a reply

Server time is: 2024-11-23 12:21:40
Your offset time is: 2024-11-23 12:21:40