How to release array memory?

Just starting out? Need help? Post your questions and find answers here.
laborde
User
User
Posts: 11
Joined: Fri Feb 17, 2006 1:45 am
Location: Fort Walton Beach, Florida

How to release array memory?

Post by laborde »

PureBasic Help says the following, "To delete the content of an array and release its used memory during program flow, call Dim with array name and 0 elements." Does this work, and if so, what is the format? I can't seem to get it to work
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it does work, but the first element stays callable, only loses its value.

dunno if it's handeled like a single variable then.

Code: Select all

EnableExplicit

Dim a(100)

a(0) = 50

Debug a(0)

Dim a(0)

Debug a(0)
oh... and have a nice day.
laborde
User
User
Posts: 11
Joined: Fri Feb 17, 2006 1:45 am
Location: Fort Walton Beach, Florida

Post by laborde »

Thanks for the response! My first introduction to EnableExplicit.
Post Reply