Jump to content

(36) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:


 Share

Recommended Posts

#include <IE.au3>
#include <array.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 104, 104, 36, 17)
$Label2 = GUICtrlCreateLabel("Label2", 96, 136, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

EndSwitch
WinActivate("anysite")
$oIE = _IEAttach("anysite")
$oFrameBB2 = _IEFrameGetObjByName($oIE, "middle")
$oTable = _IETableGetCollection ($oFrameBB2, 7)
$aTableData = _IETableWriteToArray ($oTable, True)
GuiCtrlSetData($Label1, $aTableData[0])
GuiCtrlSetData($Label2, $aTableData[1])
WEnd

Getting this error :

(36) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

Link to comment
Share on other sites

Off hand I'd say that you should check to make sure that _IETableWriteToArray() returned something useful. I'd go with:

ConsoleWrite (Ubound ($aTableData) & @LF)
But there are any number of ways to debug this kinda thing, and it's mostly up to your preference.

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Off hand I'd say that you should check to make sure that _IETableWriteToArray() returned something useful. I'd go with:

ConsoleWrite (Ubound ($aTableData) & @LF)
But there are any number of ways to debug this kinda thing, and it's mostly up to your preference.

Yeah I get values, I used the _ArrayDisplay

EDIT: Values

[0]|Rank progress
[1]|44%
Edited by c4mpi
Link to comment
Share on other sites

Ok, so what does it look like?

Is there a sample site we can use to replicate the error?

Edit: Posted as c4mpi was editing their post.

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

#include <IE.au3>
#include <array.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 104, 104, 36, 17)
$Label2 = GUICtrlCreateLabel("Label2", 96, 136, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

EndSwitch
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData = _IETableWriteToArray ($oTable, True)
GuiCtrlSetData($Label2, $aTableData[0])
GuiCtrlSetData($Label1, $aTableData[1])
WEnd

Edited by c4mpi
Link to comment
Share on other sites

Ahhh, answer's almost always in the documentation, no? Posted Image

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Getting this error :

(36) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

Ahem, again:

P.S. The table should produce a 2D array, but you only have one subscript. What do you get for Ubound($aTableData, 0)?

You don't see how that might be related to your current issue...?

:(

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

GuiCtrlSetData($Label2, $aTableData[0])

GuiCtrlSetData($Label1, $aTableData[1])

didnt see it sorry :(

Edit : I have 2D in the code above

No, you don't. That would look more like:

GuiCtrlSetData($Label2, $aTableData[0][0])

GuiCtrlSetData($Label1, $aTableData[0][1])

:) Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Error fixed :

#include <IE.au3>
#include <array.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 104, 104, 36, 17)
$Label2 = GUICtrlCreateLabel("Label2", 96, 136, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

EndSwitch
$oIE = _IEAttach("US Mafia")
$oFrameBB2 = _IEFrameGetObjByName($oIE, "middle")
$oTable = _IETableGetCollection ($oFrameBB2, 7)
$aTableData = _IETableWriteToArray ($oTable, True)
GuiCtrlSetData($Label2, $aTableData[0][0])
GuiCtrlSetData($Label1, $aTableData[1][0])

WEnd

Thanks PsaltyDS for setting me on the right track :(

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