Sign in to follow this  
Followers 0
Jury

getting data from _IETableWriteToArray

8 posts in this topic

#1 ·  Posted (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 by Jury

Share this post


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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

No error codes the script just ends. 

Share this post


Link to post
Share on other sites

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

Share this post


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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

Share this post


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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


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....

Share this post


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
Sign in to follow this  
Followers 0