nbala75 Posted December 30, 2010 Share Posted December 30, 2010 I just wonder whether this display is correct??I had this array and its position [0][0] gives us the total number of rows and cols, which is "13"Once after deleting one row, how come it still shows the same number 13, eventhough it has only 12 rows Link to comment Share on other sites More sharing options...
Malkey Posted December 30, 2010 Share Posted December 30, 2010 No bug, just lack of understanding. The help file will help. This example works. #include <Array.au3> Local $avArray[10][2] = [[9, 2],["", "Holger"],["", "Jon"],["", "Larry"],["", "Jeremy"], _ ["", "Valik"],["", "Cyberslug"],["", "Nutster"],["", "JdeB"],["", "Tylo"]] _ArrayDisplay($avArray, "$avArray BEFORE _ArrayDelete()") _ArrayDelete($avArray, 8) $avArray[0][0] = UBound($avArray) - 1 _ArrayDisplay($avArray, "$avArray AFTER _ArrayDelete()") Link to comment Share on other sites More sharing options...
nbala75 Posted December 30, 2010 Author Share Posted December 30, 2010 No bug, just lack of understanding. The help file will help. This example works. #include <Array.au3> Local $avArray[10][2] = [[9, 2],["", "Holger"],["", "Jon"],["", "Larry"],["", "Jeremy"], _ ["", "Valik"],["", "Cyberslug"],["", "Nutster"],["", "JdeB"],["", "Tylo"]] _ArrayDisplay($avArray, "$avArray BEFORE _ArrayDelete()") _ArrayDelete($avArray, 8) $avArray[0][0] = UBound($avArray) - 1 _ArrayDisplay($avArray, "$avArray AFTER _ArrayDelete()") Yup, Ubound works....but all iam asking is that, shud it not show the correct number of rows as 12 (without forcibly using Ubound)? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 30, 2010 Moderators Share Posted December 30, 2010 nbala75, shud it not show the correct number of rows as 12 (without forcibly using UboundNo. AutoIt will often give you the number of elements in the [0] (or [0][0])) element of an array as part of the array creation function but it is up to you to adjust the count if you alter the number of elements in array. Remember that many arrays do not have a count in that element - AutoIt cannot read your mind to know whether to alter that element or not. And it is not too difficult to do it yourself - add 1 if you add an element, subtract 1 if you delete one. 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