thepip3r Posted April 27, 2008 Share Posted April 27, 2008 Right now, I'm just looping through the elements and using _ArrayDelete but is there just a function I can pass an array to make all of it's contents gone? i.e. _ArrayEmpty($arr)?? My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume Link to comment Share on other sites More sharing options...
-Ultima- Posted April 27, 2008 Share Posted April 27, 2008 (edited) AutoIt makes it easy. Simply reassigning a value to the array, or allowing it to go out of scope is enough to destroy the array. (Yes, nested arrays would be properly destroyed as well) So basically, if you have Global $avArray[100000] and assign values to it, doing something like $avArray = 0 is enough to delete the entire array. Edited April 27, 2008 by -Ultima- [ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ] Link to comment Share on other sites More sharing options...
smashly Posted April 27, 2008 Share Posted April 27, 2008 To empty an array you can use Dim. eg; Dim $Arr[100] #include <Array.au3> Dim $Arr[101]; To create an array ; fill an array with data For $i = 0 To UBound($Arr) -1 $Arr[$i] = $i Next _ArrayDisplay($Arr, "Contents of $Arr array") Dim $Arr[101]; To create an array _ArrayDisplay($Arr, "Dim $Arr[101]") $Arr = 0 ; To destroy array MsgBox(0, "IsArray($Arr)", IsArray($Arr) <> 0) Cheers Link to comment Share on other sites More sharing options...
thepip3r Posted April 27, 2008 Author Share Posted April 27, 2008 ty gents. My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now