Jump to content
Sign in to follow this  
Kip

I don't know a title for this, because I don't know what the error is.

Recommended Posts

Kip

There is a error, and I dont know where he is (because the output will only show this:)

C:\PROGRA~1\AutoIt3\Include\array.au3 (496) : ==> Array variable subscript badly formatted.: 
$iResult = StringInStr($avArray[$iCurrentPos], $vWhat2Find, $iCaseSense) 
$iResult = StringInStr($avArray[^ ERROR

This is the function where the error must be:

Func CreateEverythingForDesign()
    For $i = 0 to $Forms Step +1
        $SplittedScript = StringSplit(SCI_GETTEXT($Sci), @CRLF, 1)
        GUISetState(@SW_RESTORE,$ScriptGUI)
        $Pos = _ArraySearch ($SplittedScript, "%;Form&Start&"&$i&";%", 0, 0, 0, True)
        $Pos1 = _ArraySearch ($SplittedScript, "%;Form&Created&"&$i&";%", 0, 0, 0, True)
        
        For $ii = $Pos To $Pos1 Step +1
            $Pos2 = _ArraySearch ($SplittedScript, "GUICreate(", $ii, $ii, 0, True)
            If @error = 6 Then
            Else
                $GUICtrlFunctions = StringSplit($SplittedScript[$Pos2], ",")
                MsgBox(0,"dddd",$GUICtrlFunctions[1])
            EndIf
        Next
    Next
    
EndFunc

Thnx, Kip

Edited by kip

Share this post


Link to post
Share on other sites
Valuater

1

This tells you the error was made/found in the array.au3 include ( you included at the top of your script )

C:\PROGRA~1\AutoIt3\Include\array.au3 (496)

2

The 496 tells you what line the error was found on

3

With "Array variable subscript badly formatted" and

"$iResult = StringInStr($avArray[$iCurrentPos], $vWhat2Find, $iCaseSense)

$iResult = StringInStr($avArray[^ ERROR"

You use StringSplit() here

$SplittedScript = StringSplit(SCI_GETTEXT($Sci), @CRLF, 1)

maybe you could test that array

If Not IsArray($SplittedScript) Then MsgBox()

Lastly I cant help with the array search in the reg-express style you used... but if the above doesn't help, its most likely there

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Kip

496 means the line 496 in array.au3, and $SplittedString is always a array. (in my script)

And if he says that there is an error in Array.au3, then he must be called from of the _ArraySearch functions, and not from the StringSplit function

Edited by kip

Share this post


Link to post
Share on other sites
Valuater

Yes the error is occurring in the _ArraySearch() function, however, it is being sent incorrect information... or a non-array

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Kip

damn, the only thing that I had to do is changing the 0 to a 1:

With error

For $i = 0 to $Forms Step +1
Without error
For $i = 1 to $Forms Step +1

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  

×