Sign in to follow this  
Followers 0
litlmike

Making a Variable Null

4 posts in this topic

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



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

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  
Followers 0