Jury Posted June 15, 2013 Posted June 15, 2013 (edited) Why doesn't this work? I get the table (an array of 108 x 6) but it won't list it out. I've put the six items in the first line in the array at the bottom of script. #include <IE.au3> #include <Array.au3> $oIE = _IECreate("http://www...", 1, 0, 1) Sleep(4000) ;$oIE = _IEAttach("Search") $oTable = _IETableGetCollection($oIE, 2) $aTableData = _IETableWriteToArray($oTable, True) _ArrayDisplay($aTableData) For $i = 0 To UBound($aTableData) - 1 ConsoleWrite($aTableData[$i] & @CRLF) Next ;0 [1] ;1 22 May 2013 ;2 Queen v Kasper Stamers ;3 2013 NICC 11 ;4 Weir J ;5 HTML Download Edited June 15, 2013 by Jury
water Posted June 15, 2013 Posted June 15, 2013 Do you get any error messages on the SciTE console pane? 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
Jury Posted June 15, 2013 Author Posted June 15, 2013 Sorry - I should have persisted in search the forum I found the answer - 2 dimension array so I should be using something like: For $i = 1 To 3 For $k = 1 To 4 ConsoleWrite($aTableData[$i][$k] & @CRLF) Next Next
water Posted June 15, 2013 Posted June 15, 2013 Yes, but _ArrayDisplay should have worked all the time because it supports 2D arrays too. 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
Jury Posted June 15, 2013 Author Posted June 15, 2013 water, Sorry to waste your valuable time (I do mean this you seem to help some many of us) I did get the _ArrayDisplay but just couldn't work out how to list everything to console. Thanks
water Posted June 15, 2013 Posted June 15, 2013 No problem. My time is as valuable as everyone's time Just wanted you to see that if you post as much information as possiblel (error messages, your code, input data, expected and given result ...) it makes it easier for us to help. In your case you would have gotten an error message when trying to access a 2D array with only one index as shown in your OP. 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
Gianni Posted June 15, 2013 Posted June 15, 2013 try the nested loop in this way For $x = 0 To UBound($aTableData,1) - 1 ; first dimension of array (rows) for $y = 0 to UBound($aTableData,2) - 1 ; second dimension of array (columns) ConsoleWrite($aTableData[$x][$y] & " ") ; print the elements in a row Next ConsoleWrite(@CRLF) ; new line for next row Next so the whole listing..... #include <IE.au3> #include <Array.au3> $oIE = _IECreate("http://www...", 1, 0, 1) Sleep(4000) ;$oIE = _IEAttach("Search") $oTable = _IETableGetCollection($oIE, 2) $aTableData = _IETableWriteToArray($oTable, True) _ArrayDisplay($aTableData) For $x = 0 To UBound($aTableData,1) - 1 ; first dimension of array for $y = 0 to UBound($aTableData,2) - 1 ; second dimension of array ConsoleWrite($aTableData[$x][$y] & " ") ; print the elements in a row Next ConsoleWrite(@CRLF) ; new line for next row Next bye Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
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