Jump to content

Array stupid question


2dkot
 Share

Recommended Posts

Guys, please, I need your advise

Script doesn't work and I think that it is something wrong with this array:

WinWaitActive('Письмо от юридического лица "ин: СК под: 101-9 №: 40 г: 8 05.11.2008"',"", 1)

$size = WinGetPos('Письмо от юридического лица "ин: СК под: 101-9 №: 40 г: 8 05.11.2008"', "")

If $size[0]>290 Then mousemove ($size[0]+1,$size[1]+1) mouseclick("left")

I got Error: Subscript used with non-Array variable.

I want just to drag some window to the correct position.

Thanks for any comment

Link to comment
Share on other sites

Guys, please, I need your advise

Script doesn't work and I think that it is something wrong with this array:

WinWaitActive('Письмо от юридического лица "ин: СК под: 101-9 №: 40 г: 8 05.11.2008"',"", 1)

$size = WinGetPos('Письмо от юридического лица "ин: СК под: 101-9 №: 40 г: 8 05.11.2008"', "")

If $size[0]>290 Then mousemove ($size[0]+1,$size[1]+1) mouseclick("left")

I got Error: Subscript used with non-Array variable.

I want just to drag some window to the correct position.

Thanks for any comment

You got this error, because the window possibly doesn't exists. Then, returned value($size) isn't an Array.

If your window exists, check if the name of the title requested it's correct.

$sTitle= "Title"
WinWaitActive($sTitle,"", 1)
If WinExists( $sTitle ) Then
    $size = WinGetPos($sTitle, "")
    If $size[0]>290 Then
        mousemove ($size[0]+1,$size[1]+1)
        mouseclick("left")
    Endif
EndIf
Edited by Josbe
Link to comment
Share on other sites

You got this error, because the window possibly doesn't exists. Then, returned value($size) isn't an Array.

If your window exists, check if the name of the title requested it's correct.

$sTitle= "Title"
WinWaitActive($sTitle,"", 1)
If WinExists( $sTitle ) Then
    $size = WinGetPos($sTitle, "")
    If $size[0]>290 Then
        mousemove ($size[0]+1,$size[1]+1)
        mouseclick("left")
    Endif
EndIf
Thanks for help. It works.
Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...