Jump to content

_FFTableWriteToArray error


Recommended Posts

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!

Link to comment
Share on other sites

$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)

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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]

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

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