Jump to content
Sign in to follow this  
Surgery

subscript used with non-array variable

Recommended Posts

Hey all,

Ok, everything in my script seems to work fine except for when I close the program it runs (tonic.exe). Here's my code:

Run('in\Tonic.exe')
WinWaitActive('Macromedia Flash Player 8')
$size = WinGetPos('Macromedia Flash Player 8')
WinSetTitle('Macromedia Flash Player 8', '', 'Tonic V0.9')
while WinExists('Tonic V0.9')
    $nSize = WinGetPos('Tonic V0.9')
    if $size[2] <> $nSize[2] Or $size[3] <> $nSize[3] then
        WinMove('Tonic V0.9', '', $size[0], $size[1], $size[2], $size[3])
    endif
WEnd

all it's supposed to do is resize the window to it's original size if the user tries to resize it. It works fine, but when I close Tonic.exe I get an error that says "subscript used with non-array variable". I can't seem to find anywhere in my code where I do this. Also, it only seems to happen after I open and close Tonic.exe about four or five times, but then it happens every time again for quite a while. Is there something I should have in there about stopping the script when the window closes? Thanks.

--Surgery

Share this post


Link to post
Share on other sites

Maybe...

Run('in\Tonic.exe')
WinWaitActive('Macromedia Flash Player 8')
$size = WinGetPos('Macromedia Flash Player 8')
WinSetTitle('Macromedia Flash Player 8', '', 'Tonic V0.9')
While WinExists('Tonic V0.9')
    $nSize = WinGetPos('Tonic V0.9')
    If IsArray($nSize) And IsArray($size) Then
        If $size[2] <> $nSize[2] Or $size[3] <> $nSize[3] Then
            WinMove('Tonic V0.9', '', $size[0], $size[1], $size[2], $size[3])
        EndIf
    Else
        MsgBox(0x0, "Test", "Size is the same", 2) ; this is just for testing
    EndIf
WEnd

8)

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  

×
×
  • Create New...