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 comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...