Jump to content

getting data from _IETableWriteToArray


Recommended Posts

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 by Jury
Link to post
Share on other sites

Do you get any error messages on the SciTE console pane?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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 (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

Yes, but _ArrayDisplay should have worked all the time because it supports 2D arrays too.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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 (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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 (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

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

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...