Chimaera Posted August 17, 2014 Posted August 17, 2014 Been looking at _ArrayDelete as i have an array i cant seem to exclude one folder from This is a non working example $CleanUpFolders = _FileListToArrayRec(@ScriptDir, "*||Downloaded_Files", 2, 1) ; Make a variable of the second unpacked files for cleanup and exclude the unpacker _ArrayDisplay($CleanUpFolders, "Retest Cleanup Folders") For $i = 1 To $CleanUpFiles[0] DirRemove( $CleanUpFiles[$i], 1) Sleep(100) Next prob is with _FileListToArrayRec it doesnt exclude the folder because of this condition Exclude_Folders = only used if $iRecur = 1 AND $iReturn <> 2 to exclude defined folders (default = "" [none]) there is a load of folders that i want to remove and one that i dont (Downloaded_Files) These dont work #include <Array.au3> Local $aArray[5] = [0, 1, 'Test', 3, 4] _ArrayDisplay($aArray, "Original") _ArrayDelete($aArray, 'Test',) _ArrayDisplay($aArray, "Element 2 deleted") #include <Array.au3> Local $aArray[5] = [0, 1, 'Test', 3, 4] _ArrayDisplay($aArray, "Original") Local $del = 'Test' _ArrayDelete($aArray, $del) _ArrayDisplay($aArray, "Element 2 deleted") So how do i remove it from the array before processing and i dont know the postion number in the array as it will be different everytime If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
mikell Posted August 17, 2014 Posted August 17, 2014 ? #include <Array.au3> Local $aArray[5] = [0, 1, 'Test', 3, 4] _ArrayDisplay($aArray, "Original") For $i = UBound($aArray)-1 to 0 step -1 If $aArray[$i] == "Test" Then _ArrayDelete($aArray, $i) Exitloop EndIf Next _ArrayDisplay($aArray, "Element 2 deleted")
Chimaera Posted August 17, 2014 Author Posted August 17, 2014 Thx mikell nicely done If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
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