qwert Posted February 12, 2017 Posted February 12, 2017 Would anyone happen to know why _AddArray appends a couple of blank lines to the contents? I've only recently started to use some of the update/add features and am at a loss about this effect ... even what to try as a test ... although I did find this good explanation of items and subitems: ListView Items and Subitems Here's my test script that produces the GUI I've attached: expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Local $array[5][3] = [ ['C:\Program Files','12/01/2016','201'], _ ['D:\Au3 Scripts','07/03/2014','301'], _ ['F:\Downloads','01/01/2017','101'] ] $GUI = GUICreate("ListView Test", 400, 320, -1, 180) $Go = GUICtrlCreateButton("Go", 324, 84, 60, 28) GUICtrlSetTip(-1, "Select a listview entry and click Go") $Elements = GUICtrlCreateListView("", 24, 12, 280, 280) _GUICtrlListView_AddColumn($Elements, "Directory Name", 200) _GUICtrlListView_AddColumn($Elements, "Date", 76) _GUICtrlListView_AddColumn($Elements, "Unseen sort", 0) _GUICtrlListView_AddArray($Elements, $array) ; where are blank lines coming from? ;_GUICtrlListView_AddArray($Elements, $array) ; even this results in 2 blank lines Local $item = _GUICtrlListView_AddItem($Elements, "F:\Newest") _GUICtrlListView_AddSubItem($Elements, $item, "01/01/2015", 1) _GUICtrlListView_AddSubItem($Elements, $item, "001", 2) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Go $Line = _GUICtrlListView_GetItemTextString($Elements) msgbox(0, "Operation", $Line) EndSwitch WEnd I'll certainly appreciate any help with this. Thanks.
aa2zz6 Posted February 12, 2017 Posted February 12, 2017 Change your array to [3][3].. the [5][3] adds 2 lines Local $array[3][3]
qwert Posted February 12, 2017 Author Posted February 12, 2017 Fixed. "It's all details!" ... and I didn't see that. Thanks very much.
water Posted February 12, 2017 Posted February 12, 2017 Or let AutoIt manage the size of the array: Local $array[][] = [ ['C:\Program Files','12/01/2016','201'], _ ['D:\Au3 Scripts','07/03/2014','301'], _ ['F:\Downloads','01/01/2017','101'] ] aa2zz6 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
qwert Posted February 12, 2017 Author Posted February 12, 2017 @water: that's a very good suggestion. Predefining has tripped me up, before ... yet I've never used [ ][ ]. Thanks.
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