Chimaera Posted June 8, 2015 Share Posted June 8, 2015 I recently was helped with some code by melba like thisFor $removeloop = UBound($aRemoveArray) - 1 To 1 Step -1 $search = _ArraySearch($aList, $aRemoveArray[$removeloop]) $test = _ArrayDelete($aList, $search) Sleep(10) Nextbut ive got this working as well which i had on another scriptFor $removeloop = 1 To UBound($aRemoveArray) - 1 Local $iIndex = _ArraySearch($aList, $aRemoveArray[$removeloop]) ; Look for the index of the item If $iIndex <> -1 Then ; If found... _ArrayDelete($aList, $iIndex) ; ...then remove it EndIf Nextbut the second one doesnt wait as long as the first?Why is this the case? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 8, 2015 Moderators Share Posted June 8, 2015 Chimaera,If you have a lot of items in $aRemoveArray then all those Sleep(10) commands will add up to a significant delay.And although I cannot imagine it being a factor here, in the first snippet I would also question the need to run through the array backwards. You need to do this if you are deleting elements of the same array that you use for the count, but that is not the case here. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Chimaera Posted June 8, 2015 Author Share Posted June 8, 2015 Thats what happens when you stare at code too long.... you miss the obvious because your looking for the complicated...The 1st array eg was from you and i couldnt work out why it was like that If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 8, 2015 Moderators Share Posted June 8, 2015 Chimaera,A fresh pair of eyes is always useful.When I originally posted, I probably made the general point without looking too closely at the specific case - my apologies if that was indeed what happened.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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