Sign in to follow this  
Followers 0
Longneck

Array variable subscript badly formatted

16 posts in this topic

This simple script won't go. Always get the following error in console window:

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2122) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

I am using latest available AutoIt and Scite.

#include <IE.au3>

$oIE = _IECreate()
WinSetState ("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE)
_IENavigate ($oIE, "http://www.google.de")

$o_Table = _IETableGetCollection($oIE, 1)
$o_TableData = _IETableWriteToArray($o_Table)
For $i = 0 To UBound($o_TableData) - 1
    For $y = 0 To UBound($o_TableData, 2) - 1
        ConsoleWrite($o_TableData[$i][$y] & @CRLF)
    Next
Next

Share this post


Link to post
Share on other sites



This simple script won't go. Always get the following error in console window:

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2122) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

I am using latest available AutoIt and Scite.

#include <IE.au3>

$oIE = _IECreate()
WinSetState ("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE)
_IENavigate ($oIE, "http://www.google.de")

$o_Table = _IETableGetCollection($oIE, 1)
$o_TableData = _IETableWriteToArray($o_Table)
For $i = 0 To UBound($o_TableData) - 1
    For $y = 0 To UBound($o_TableData, 2) - 1
        ConsoleWrite($o_TableData[$i][$y] & @CRLF)
    Next
Next

Works fine for me... can you show the all output in the SciTE outputpane ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Works fine for me... can you show the all output in the SciTE outputpane ?

>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "E:\YRM\test2.au3" /autoit3dir "C:\Programme\AutoIt3\beta" /UserParams

+> Starting AutoIt3Wrapper v.1.7.3

>Running AU3Check (1.54.4.0) params: from:C:\Programme\AutoIt3\beta

+>AU3Check ended.rc:0

>Running:(3.2.1.11):C:\Programme\AutoIt3\beta\autoit3.exe "E:\YRM\test2.au3"

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2122) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.977

Share this post


Link to post
Share on other sites

>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "E:\YRM\test2.au3" /autoit3dir "C:\Programme\AutoIt3\beta" /UserParams

+> Starting AutoIt3Wrapper v.1.7.3

>Running AU3Check (1.54.4.0) params: from:C:\Programme\AutoIt3\beta

+>AU3Check ended.rc:0

>Running:(3.2.1.11):C:\Programme\AutoIt3\beta\autoit3.exe "E:\YRM\test2.au3"

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2122) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.977

Strange, looks fine except: Just checked ie.au3 line 2122 and my version has that line on 2123 ... Did you make any changes in ie.au3?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Strange, looks fine except: Just checked ie.au3 line 2122 and my version has that line on 2123 ... Did you make any changes in ie.au3?

No. Just redownloaded and installed latest AutoIt beta.

My version also has this line on 2123 but console window shows always line 2122

Don't know why?!

Edited by Longneck

Share this post


Link to post
Share on other sites

No. Just redownloaded and installed latest AutoIt beta.

My version also has this line on 2123 but console window shows always line 2122

Don't know why?!

What IE version are you using ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What IE version are you using ?

IE 6.0.2900.2180.xpsp2_gdr.050301-1519

In the mean time error message changed to line 2123

>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "E:\YRM\test2.au3" /autoit3dir "C:\Programme\AutoIt3" /UserParams

+> Starting AutoIt3Wrapper v.1.7.3

>Running AU3Check (1.54.3.0) params: from:C:\Programme\AutoIt3

+>AU3Check ended.rc:0

>Running:(3.2.0.1):C:\Programme\AutoIt3\autoit3.exe "E:\YRM\test2.au3"

C:\PROGRA~1\AutoIt3\Include\IE.au3 (2123) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.368

Share this post


Link to post
Share on other sites

can you renamed the ie.au3 and save the attached in the Beta\include directory, then run your script and see what the values for $i_cols and $i_rows are ..(they will be displayed in the outputpane)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

can you renamed the ie.au3 and save the attached in the Beta\include directory, then run your script and see what the values for $i_cols and $i_rows are ..(they will be displayed in the outputpane)

Here's the result:

>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "E:\YRM\test2.au3" /autoit3dir "C:\Programme\AutoIt3\beta" /UserParams

+> Starting AutoIt3Wrapper v.1.7.3

>Running AU3Check (1.54.4.0) params: from:C:\Programme\AutoIt3\beta

+>AU3Check ended.rc:0

>Running:(3.2.1.11):C:\Programme\AutoIt3\beta\autoit3.exe "E:\YRM\test2.au3"

@@ Debug(2122) : $i_cols = 0

>Error code: -2147467262

@@ Debug(2122) : $i_rows = 2

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2124) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.067

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

@@ Debug(2122) : $i_cols = 0

>Error code: -2147467262

@@ Debug(2122) : $i_rows = 2

C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2124) : ==> Array variable subscript badly formatted.:

Local $a_TableCells[$i_cols][$i_rows]

Local $a_TableCells[^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.067

That explains your error $i_cols = 0 so the function is trying to create an Array with 0 subscripts.

Maybe Dale knows why its doing this ?

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

That explains your error $i_cols = 0 so the function is trying to create an Array with 0 subscripts.

Maybe Dale knows why its doing this ?

Anyway thx for your efforts.

Maybe Dale can help me out.

Share this post


Link to post
Share on other sites

Anyway thx for your efforts.

Maybe Dale can help me out.

I cannot reproduce this either. The table you are trying to access looks like the data below (I've reformatted) and the $i_cols should equal 3, not 0.

<table cellspacing=0 cellpadding=0>
<tr>
<td width=25%>
    &nbsp;
</td>
<td align=center>
    <input type=hidden name=hl value=de>
    <input maxlength=2048 size=55 name=q value="" title="Google-Suche"><br>
    <input type=submit value="Google-Suche" name=btnG>
    <input type=submit value="Auf gut Glück!" name=btnI>
</td>
<td valign=top nowrap width=25%>
    <font size=-2>&nbsp;&nbsp;
    <a href=/advanced_search?hl=de>Erweiterte Suche</a><br>&nbsp;&nbsp;
    <a href=/preferences?hl=de>Einstellungen</a><br>&nbsp;&nbsp;
    <a href=/language_tools?hl=de>Sprachtools</a>
    </font>
</td>
</tr>
<tr>
<td colspan=3 align=center><font size=-1>Suche: 
    <input id=all type=radio name=meta value="" checked>
    <label for=all> Das Web </label>
    <input id=lgr type=radio name=meta value="lr=lang_de" >
    <label for=lgr> Seiten auf Deutsch </label>
    <input id=cty type=radio name=meta value="cr=countryDE" >
    <label for=cty> Seiten aus Deutschland </label>
    </font>
</td>
</tr>
</table>

For testing, I modified your code a bit:

#include <IE.au3>

$oIE = _IECreate("http://www.google.de")
$o_Table = _IETableGetCollection($oIE, 1)
ConsoleWrite($o_Table.outerHTML & @CR & "-----------------------" & @CR)
$o_TableData = _IETableWriteToArray($o_Table)
For $i = 0 To UBound($o_TableData) - 1
    For $y = 0 To UBound($o_TableData, 2) - 1
        ConsoleWrite("[" & $i & "]" & "[" & $y & "]: " & _
            $o_TableData[$i][$y] & @CRLF)
    Next
NextoÝ÷ ضØ^±êÞ²ém±«­¢+ØÐíIÕ¹¹¥¹è ̸ȸÀ¸Ä¤éèÀäÈíAɽɴ¥±ÌÀäÈíÕѽ%ÐÌÀäÈíÕѽ¥Ð̹áÅÕ½ÐíèÀäÈíÕѽ%ÑMÉ¥ÁÑÌÀäÈíѵÀµÕÉɱ°¹ÔÌÅÕ½Ðì((±ÐíQ  1±±MÁ¥¹ôÀ±±A¥¹ôÀÐì±ÐíQ    =dÐì(±ÐíQHÐì(±ÐíQÝ¥Ñ ôÅÕ½ÐìÈÔÅÕ½ÐìÐìµÀí¹ÍÀì±Ðì½QÐì(±ÐíQ±¥¸õµ¥±Ðì±Ðí%9AUPÑåÁõ¡¥¸Ù±Õõ¹µõ¡°Ðì±Ðí%9AUPѥѱõ½½±µMÕ¡µá1¹Ñ ôÈÀÐàÍ¥éôÔÔ¹µõÄÐì±Ðí    HÐì±Ðí%9AUPÑåÁõÍÕµ¥ÐÙ±Õõ½½±µMÕ¡¹µõѹÐì±Ðí%9AUPÑåÁõÍÕµ¥ÐÙ±ÕôÅÕ½ÐíÕÕгñ¬ÌÌìÅÕ½Ðì¹µõѹ$Ðì±Ðì½QÐì(±ÐíQÙ±¥¸õѽÀ¹½]ÉÀÝ¥Ñ ôÅÕ½ÐìÈÔÅÕ½ÐìÐì±Ðí=9PÍ¥éô´ÈÐìµÀí¹ÍÀìµÀí¹ÍÀì±Ðí¡ÉôÅÕ½Ðì½Ù¹}ÍÉ ý¡°õÅÕ½ÐìÐíÉÝ¥ÑÉÑMÕ¡±Ðì½Ðì±Ðí  HÐìµÀí¹ÍÀìµÀí¹ÍÀì±Ðí¡ÉôÅÕ½Ðì½ÁÉɹÌý¡°õÅÕ½ÐìÐí¥¹Íѱ±Õ¹¸±Ðì½Ðì±Ðí   HÐìµÀí¹ÍÀìµÀí¹ÍÀì±Ðí¡ÉôÅÕ½Ðì½±¹Õ}ѽ½±Ìý¡°õÅÕ½ÐìÐíMÁɡѽ½±Ì±Ðì½Ðì±Ðì½=9PÐì±Ðì½QÐì±Ðì½QHÐì(±ÐíQHÐì(±ÐíQ±¥¸õµ¥±½±MÁ¸ôÌÐì±Ðí=9PÍ¥éô´ÄÐíMÕ¡è±Ðí%9AUP¥õ±°ÑåÁõÉ¥¼
!
-Ù±ÕôÅÕ½ÐìÅÕ½Ðì¹µõµÑÐì±Ðí1  0½Èõ±°ÐìÌ]±Ðì½1 0Ðì±Ðí%9AUP¥õ±ÈÑåÁõÉ¥¼Ù±Õõ±Èõ±¹}¹µõµÑÐì±Ðí1  0½Èõ±ÈÐìM¥Ñ¸ÕÕÑÍ ±Ðì½1    0Ðì±Ðí%9AUP¥õÑäÑåÁõÉ¥¼Ù±ÕõÈõ½Õ¹ÑÉå¹µõµÑÐì±Ðí1 0½ÈõÑäÐìM¥Ñ¸ÕÌÕÑÍ¡±¹±Ðì½1 0Ðì±Ðì½=9PÐì±Ðì½QÐì±Ðì½QHÐì±Ðì½Q    =dÐì±Ðì½Q 1Ðì(´´´´´´´´´´´´´´´´´´´´´´´)lÁulÁtè)lÁulÅtèMÕ¡èÌ]M¥Ñ¸ÕÕÑÍ M¥Ñ¸ÕÌÕÑÍ¡±¹)lÅulÁtèÀ)lÅulÅtè)lÉulÁtèÉÝ¥ÑÉÑMÕ¡(¥¹Íѱ±Õ¹¸(MÁɡѽ½±Ì)lÉulÅtè(¬ÐíÕѽ%P̹ṹÉè

I can think of no good reason that your results would be different.

My next suggestion would be to get out of all IE windows and then check the task manager to insure that you no longer have any IEXPLORE.EXE processes running -- kill them if so. Obviously logging out or rebooting would get the same result. Then test again and report your results.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I can think of no good reason that your results would be different.

My next suggestion would be to get out of all IE windows and then check the task manager to insure that you no longer have any IEXPLORE.EXE processes running -- kill them if so. Obviously logging out or rebooting would get the same result. Then test again and report your results.

Dale

After several restarts, multiple apps killed in the task manager - always the same.

Only one IEXPLORE.EXE process but the error remains. Here's the SciTe output from your modified code:

>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "E:\YRM\test2.au3" /autoit3dir "C:\Programme\AutoIt3\beta" /UserParams  
+> Starting AutoIt3Wrapper v.1.7.3
>Running AU3Check (1.54.4.0)  params:  from:C:\Programme\AutoIt3\beta
+>AU3Check ended.rc:0
>Running:(3.2.1.11):C:\Programme\AutoIt3\beta\autoit3.exe "E:\YRM\test2.au3"    

<TABLE cellSpacing=0 cellPadding=0><TBODY>
<TR>
<TD width="25%"> </TD>
<TD align=middle><INPUT type=hidden value=de name=hl><INPUT title=Google-Suche maxLength=2048 size=55 name=q><BR><INPUT type=submit value=Google-Suche name=btnG><INPUT type=submit value="Auf gut Glück!" name=btnI></TD>
<TD vAlign=top noWrap width="25%"><FONT size=-2>  <A href="/advanced_search?hl=de">Erweiterte Suche</A><BR>  <A href="/preferences?hl=de">Einstellungen</A><BR>  <A href="/language_tools?hl=de">Sprachtools</A></FONT></TD></TR>
<TR>
<TD align=middle colSpan=3><FONT size=-1>Suche: <INPUT id=all type=radio CHECKED value="" name=meta><LABEL for=all> Das Web </LABEL><INPUT id=lgr type=radio value=lr=lang_de name=meta><LABEL for=lgr> Seiten auf Deutsch </LABEL><INPUT id=cty type=radio value=cr=countryDE name=meta><LABEL for=cty> Seiten aus Deutschland </LABEL></FONT></TD></TR></TBODY></TABLE>
-----------------------
@@ Debug(2122) : $i_cols = 0
>Error code: -2147467262
@@ Debug(2122) : $i_rows = 2
C:\PROGRA~1\AutoIt3\beta\Include\IE.au3 (2124) : ==> Array variable subscript badly formatted.: 
Local $a_TableCells[$i_cols][$i_rows] 
Local $a_TableCells[^ ERROR
+>AutoIT3.exe ended.rc:0
>Exit code: 0   Time: 3.489

Share this post


Link to post
Share on other sites

This doesn't make sense taht you would get different results that Jos and I. Can you think of any reason that your environment would be different than ours?

Custom browser? Local language set on your system? ???

What we'll need to do next is copy the _IETableWriteToArray function into your script and give it a new name and then call it instead. Then pepper the function with debug statements to see why $i_cols is not getting set to a non-zero value.

I don't have time to set up a test version now, so if you can make some progress, please let me know. Otherwise, I'll put a test version together when I have a little time.

thanks,

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

This doesn't make sense taht you would get different results that Jos and I. Can you think of any reason that your environment would be different than ours?

Custom browser? Local language set on your system? ???

What we'll need to do next is copy the _IETableWriteToArray function into your script and give it a new name and then call it instead. Then pepper the function with debug statements to see why $i_cols is not getting set to a non-zero value.

I don't have time to set up a test version now, so if you can make some progress, please let me know. Otherwise, I'll put a test version together when I have a little time.

thanks,

Dale

I just installed a quick second installation of win xp (german) on my laptop and now it works. This is a clean installation with all available windows updates. The only installed apps are autoit and scite.

I dont have a clue where's the difference to the other installation, but i will look for it.

In the meantime i will try your suggestions and tell you the result.

thx

Share this post


Link to post
Share on other sites

I have encountered a similar issue with the same Error Message, but in reviewing the Web Page and the Tables in the page, I see there is a table defined with no <TR> and no <TD> elements. It is a NULL table with no contents, and I believe that may be the cause of my issue. Not a timing issue as noted in another post, and not caused by environment of the client nor the browser version. Just a simple definition issue by the Web Page Developer in defining a <TABLE ....> with no rows or cells of information. Can someone else verify that this would cause this error and how do I go about finding a fix for this issue? Do I need to review the code in the Function Library for IE and attempt to give feedback or do I open a bug report(?) for this? Any guidence would be appreciated.

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