JackER4565 Posted March 31, 2021 Share Posted March 31, 2021 (edited) Hi all, I have a question about the example in _arrayDelete. If I run it on the spot with the example file it doesn't delete the row 3 of the array: (image 1) #include <Array.au3> Local $aArray[5] = [0, 1, 2, 3, 4] _ArrayDisplay($aArray, "Original") _ArrayDelete($aArray, 2) _ArrayDisplay($aArray, "Element 2 deleted") Local $aArray_Base[25][4] For $i = 0 To 24 For $j = 0 To 3 $aArray_Base[$i][$j] = $i & "-" & $j Next Next ; Single row $aArray = $aArray_Base _ArrayDisplay($aArray, "BEFORE deletion") _ArrayDelete($aArray, 7) _ArrayDisplay($aArray, "SINGLE ROW deleted") ; Range string $aArray = $aArray_Base Local $sRange = "0;11-15;24" _ArrayDisplay($aArray, "BEFORE deletion") _ArrayDelete($aArray, $sRange) ConsoleWrite(" " & @error & @CRLF) _ArrayDisplay($aArray, "RANGE STRING deleted") ; 1D array $aArray = $aArray_Base Local $aDel[4] = [3, 5, 11, 13] _ArrayDisplay($aArray, "BEFORE deletion") _ArrayDelete($aArray, $aDel) _ArrayDisplay($aArray, "RANGE ARRAY deleted") It should delete the rows number 3, 5, 11 and 13 but the 3rd doesn't get deleted. Additionaly I've tryied modify the example and it works even worst. The error returns 0. (image 2) Thanks in advance! Edited March 31, 2021 by JackER4565 Solved Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 31, 2021 Share Posted March 31, 2021 (edited) 25 minutes ago, JackER4565 said: It should delete the rows number 3, 5, 11 and 13 but the 3rd doesn't get deleted. When using the $vRange as a 1D array, you have to specify the number of elements to delete in the 0th element of your $vRange array, as stated in the Help file: $vRange can also be a 1D array listing all rows to be deleted with the count in the [0] element. Cheers Edited March 31, 2021 by FrancescoDiMuro JackER4565 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
JackER4565 Posted March 31, 2021 Author Share Posted March 31, 2021 1 minute ago, FrancescoDiMuro said: When using the $vRange as a 1D array, you have to specify the number of elements to delete in the 0th element of your $vRange array, as stated in the Help file: $vRange can also be a 1D array listing all rows to be deleted with the count in the [0] element. Cheers Do'h thanks so much!! FrancescoDiMuro 1 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