Sign in to follow this  
Followers 0
Thornhunt

array error [SOLVED]

11 posts in this topic

#1 ·  Posted (edited)

Line 4344 ( file "f:\progg\webb.exe"):

error array variable has incorrect number of subscripts or subscript dimension range exceeded."

im confused, about this error, since the script is only about 17 lines long :S and most of that is loops.

basicly it downloads all the wallpapers from my friends site, (wich has a random sellection of 60 on his home page)

heres the script. thankyou in advance for any help:)

#include <INet.au3>

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <String.au3>
#include <Array.au3>
While 1
    global $aArray1[60]

    $stringw = _INetGetSource('***URL***')
   $aArray1 = _StringBetween($stringw, '<a href="***URL***', '"')

    $i = 1
do
InetGet("***URL***" & $aArray1[$i],@ScriptDir & "\1\" & $aArray1[$i],0,1)
$i = $i + 1
until @error
WEnd
" Edited by Thornhunt

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites



Probably means that _StringBetween error code should be checked (@error) before continuing.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Probably means that _StringBetween error code should be checked (@error) before continuing.

after (@error'ing) that string i got the same error only line 4345 XD progress:P

hmmm this has puzzled me


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

That doesn't make enough information / code / example to be able to help you.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

That doesn't make enough information / code / example to be able to help you.

ok at the top is the compleate code.as i said its only 17 lines long ( a lil longer now i added error checks)

i put a "if not @error" just befor the string between and one just after

so if a error is picked up it will skipp that section.

If Not @error Then
        $aArray1 = _StringBetween($stringw, '<a href="***URL***', '"')
    EndIf
    If Not @error Then
        $i = 1
        Do
            Sleep(50)
            InetGet("***URL***" & $aArray1[$i], @ScriptDir & "\1\" & $aArray1[$i], 0, 1)
            $i = $i + 1
        Until @error
    EndIf
WEnd

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

The problem is with your Do..Until @error

When $i gets incremented past the last array entry, you still attempt your InetGet with an invalid $i index in array $aArray.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

thats the idea. because not all the time does 60 images load, the script downloads however many there are until there is no more (the @error)

like this

loop

download

increment

loop

download

increment

loop

download : no array

exit loop

that kind of effeect if you get me ?


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

finially my console decided to show something interesting

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "F:\progg\lol.au3"

F:\progg\lol.au3 (20) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

InetGet("***URL***" & $aArray1[$i], @ScriptDir & "\1\" & $aArray1[$i], 0, 1)

InetGet("***URL***" & ^ ERROR

>Exit code: 1 Time: 48.707


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

Exactly what I told you before. You can't catch this error, which AutoIt considers fatal (rightly). That means your Until @error won't work the way you want it to work. You need UBound($aArray) or For $str In $aArray...


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Exactly what I told you before. You can't catch this error, which AutoIt considers fatal (rightly). That means your Until @error won't work the way you want it to work. You need UBound($aArray) or For $str In $aArray...

OMG i have been hunting all day for the ubound function O.O thats through the help file and the forum, but didnt find any luck wich is why took the @error rout 4

thank you hopefully this should work beautifully now :)


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

OMG i have been hunting all day for the ubound function O.O thats through the help file and the forum, but didnt find any luck wich is why took the @error rout 4

thank you hopefully this should work beautifully now :)

Is there another way to catch fatal errors in a compiled script, something that allows me terminating with a an exit code without showing the message box of the error.

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