c4mpi Posted March 24, 2010 Share Posted March 24, 2010 #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 More sharing options...
Fulano Posted March 24, 2010 Share Posted March 24, 2010 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 More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 (edited) 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 March 24, 2010 by c4mpi Link to comment Share on other sites More sharing options...
Fulano Posted March 24, 2010 Share Posted March 24, 2010 (edited) 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 March 24, 2010 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 More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 Ok, so what does it look like?Just posted Link to comment Share on other sites More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 (edited) #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 March 24, 2010 by c4mpi Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 24, 2010 Share Posted March 24, 2010 Ahem. 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 More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 Ahem. That's another error Sorry for not editing that topic, I managed to fix that error Link to comment Share on other sites More sharing options...
Fulano Posted March 24, 2010 Share Posted March 24, 2010 Ahhh, answer's almost always in the documentation, no? #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 More sharing options...
PsaltyDS Posted March 24, 2010 Share Posted March 24, 2010 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 More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 (edited) didnt see it sorry Edit : I have 2D in the code above Edited March 24, 2010 by c4mpi Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 24, 2010 Share Posted March 24, 2010 (edited) 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 March 24, 2010 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 More sharing options...
c4mpi Posted March 24, 2010 Author Share Posted March 24, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now