Jump to content
Sign in to follow this  
litlmike

Making a Variable Null

Recommended Posts

litlmike

I have an array that I want to declare as null at the end of a script, I have seen in other languages where you can just do:

$Variable = Null

What is the equivalent in AutoIt? I have a script that always runs in the background, that I call every once in awhile. The problem is that the arrays that are created can get large and I need those memory addresses to be cleared so that I am not always allocating 30 MBs of RAM to this array.

Thanks.

Share this post


Link to post
Share on other sites
NELyon

I have an array that I want to declare as null at the end of a script, I have seen in other languages where you can just do:

$Variable = Null

What is the equivalent in AutoIt? I have a script that always runs in the background, that I call every once in awhile. The problem is that the arrays that are created can get large and I need those memory addresses to be cleared so that I am not always allocating 30 MBs of RAM to this array.

Thanks.

Maybe i don't understand correctly but wouldn't this be it?

Global $Variable= "" ;or Global $variable=0

Share this post


Link to post
Share on other sites
improbability_paradox

from the helpfile, under Dim

To erase an array (maybe because it is a large global array and you want to free the memory), simply assign a single value to it:

$array = 0

This will free the array and convert it back to the single value of 0.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.