zeenmakr Posted May 6, 2020 Share Posted May 6, 2020 (edited) https://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayDelete.htm Local $aArray_Base[25][4] For $i = 0 To 24 For $j = 0 To 3 $aArray_Base[$i][$j] = $i & "-" & $j Next Next ... ; 1D array $aArray = $aArray_Base Local $aDel[4] = [3, 5, 11, 13] ;Test 1 Default<--- it fails to Delete row 3 Local $aDel[5] = [0, 3, 5, 11, 13] ;Test 2 Workaround<--- it fails to Delete row 0, 5, 11 & 13 _ArrayDisplay($aArray, "BEFORE deletion") _ArrayDelete($aArray, $aDel) _ArrayDisplay($aArray, "RANGE ARRAY deleted") here is a section of the sample code copied from the link above, where it fails to delete 1st indicated row in $vRange. In this case it fails to delete indicated row #3 in $vRange [3, 5, 11, 13] it does delete the following row #5, 11 and 13 fine. Tested with my data and that is how i found out the hard way - this messed up my project the past couple of weeks without realizing it until now. a simple single row 3 in $vRange _ArrayDelete($aArray, 3) wihout a problem because what demonstrated above skips the 1st row in $vRange , I thought I could get away with a workaround by insert a row #0 in $vRange as [0, 3, 5, 11, 13], with an understand that I would skip 1st row in $vRange but no. It does skip 1st row in $vRange and delete row #3 in $vRange but fail to delete the following rows 5, 11 & 13 any thoughts? Edited May 6, 2020 by Melba23 Not a bug - PC-chair interface problem! Link to comment Share on other sites More sharing options...
jchd Posted May 6, 2020 Share Posted May 6, 2020 Quote $vRange can also be a 1D array listing all rows to be deleted with the count in the [0] element zeenmakr and FrancescoDiMuro 1 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
zeenmakr Posted May 6, 2020 Author Share Posted May 6, 2020 (edited) thanks, saw that but somehow it didn't click. without realizing that, my workaround almost work except, it simply need the correct count inserted (: Now I wish _ArrayFindAll() returns w/count in 1st element b/c that's what i'm relying on. thanks again Edited May 6, 2020 by zeenmakr Link to comment Share on other sites More sharing options...
Nine Posted May 6, 2020 Share Posted May 6, 2020 Just use _ArrayInsert to add ubound in cell 0. zeenmakr 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
zeenmakr Posted May 7, 2020 Author Share Posted May 7, 2020 thanks 9, just complaining Link to comment Share on other sites More sharing options...
iamtheky Posted May 7, 2020 Share Posted May 7, 2020 (edited) the helpfile also states Quote $vRange can be a string containing the rows which are to be deleted. It can be a single number or a range ... multiple items are separated by a semi-colon (;) so: local $aArray[6] = [1,2,3,2,5,2] $aDel = _ArrayFindAll($aArray , 2) _ArrayDelete($aArray , _ArrayToString($aDel , ";")) _ArrayDisplay($aArray) or reduced local $aArray[6] = [1,2,3,2,5,2] _ArrayDelete($aArray , _ArrayToString(_ArrayFindAll($aArray , 2) , ";")) _ArrayDisplay($aArray) Edited May 7, 2020 by iamtheky zeenmakr 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
zeenmakr Posted May 7, 2020 Author Share Posted May 7, 2020 _ArrayDelete($aArray , _ArrayToString(_ArrayFindAll($aArray , 2) , ";")) cool, thanks 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