Jump to content
PunkoHead

_FFTableWriteToArray error

Recommended Posts

PunkoHead

Hello Guys,

I am having troubles with the _FFTableWriteToArray function - it displays an error.

I have the following code:

#include <FF.au3>
#include <Array.au3>

_FFConnect()
$table = _FFTableWriteToArray()
_ArrayDisplay($table)

As you can see, it only connects to a FF window and tries to display the table there. This is the result:

__FFSendJavaScripts: Sending functions to FireFox .......... done
"C:\Program Files (x86)\AutoIt3\Include\FF.au3" (3019) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aTable[$j][$i] = $aRows[$i + 1]
$aTable[$j][$i] = ^ ERROR
->13:29:47 AutoIt3.exe ended.rc:1
+>13:29:47 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 2.395

In FF.au3 we have the following lines:

3015For $i = 0 To $iCols - 1
3016    $aRows = _FFXPath($sTable & "//tr//td[" & $i + 1 & "]", $sReturnMode, 6, $iFilter)
3017    If $aRows[0] > 0 Then
3018        For $j = 0 To $iRows - 1
3019            $aTable[$j][$i] = $aRows[$i + 1]
3020        Next
3021    EndIf
3022Next

I am attaching the source code of the webpage as well - Source.htm

I am also attaching my FF.au3 library

Tried different versions of it, but it shows me the same error.

Could you please let me know if there is a workaround here?

Thank you in advance!

Share this post


Link to post
Share on other sites
ajag
Posted (edited)
$aTable[$j][$i] = $aRows[$i + 1]

How do you know how many dimensions $aRows has?

 

Edited by ajag

Rule #1: Always do a backup         Rule #2: Always do a backup (backup of rule #1)

Share this post


Link to post
Share on other sites
PunkoHead

Thanks @ajag

However, the error that I receive is the same:

__FFSendJavaScripts: Sending functions to FireFox .......... done
"C:\Program Files (x86)\AutoIt3\Include\FF.au3" (3019) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aTable[$j][$i] = $aRows[$j + 1]
$aTable[$j][$i] = ^ ERROR

 

Share this post


Link to post
Share on other sites
ajag

Try

For $i = 0 To $iCols - 1
    $aRows = _FFXPath($sTable & "//tr//td[" & $i + 1 & "]", $sReturnMode, 6, $iFilter)
    
    If IsArray($aRows) Then
        _ArrayDisplay($aRows)
    EndIf
    
    If $aRows[0] > 0 Then
        For $j = 0 To $iRows - 1
            $aTable[$j][$i] = $aRows[$i + 1]
        Next
    EndIf
Next

And see how many rows there are. And then compare it to [$I + 1]

  • Thanks 1

Rule #1: Always do a backup         Rule #2: Always do a backup (backup of rule #1)

Share this post


Link to post
Share on other sites
PunkoHead

@ajag

Ok, now I got some results:

  1. Rows - 394
  2. Rows - 394
  3. Rows - 393
  4. Rows - 390
  5. Rows - 390
  6. Rows - 361
  7. Rows - 3

I guess because of the different results, I am not receiving any data?

Share this post


Link to post
Share on other sites
PunkoHead

Still not sure how to fix this. Can anyone assist me with this?

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

×