Jump to content

Help file error


dickep
 Share

Recommended Posts

Ok. I have a problem.

I went to the Autoit help file and searched on "ControGetPos". In it there is an example and a button to "Open this script". I click on that button and the file opens in SciTE. Ok so far.

Now I try to run it and the following shows up in the output pane:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\Examples\Helpfile\ControlGetPos.au3"

C:\Program Files\AutoIt3\Examples\Helpfile\ControlGetPos.au3 (3) : ==> Subscript used with non-Array variable.:

MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )

MsgBox(0, "Window Stats:", "POS: " & $pos^ ERROR

>Exit code: 1 Time: 0.563

What am I missing?

Autoit version 3.3.0.0

Thanks

Link to comment
Share on other sites

The problem is the example..

ControlGetPos() is being fired before the notepad Edit control has loaded..

It needs a WinWaitActive() or sleep() added after the Run("notepad.exe")..

Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$pos = ControlGetPos("[CLASS:Notepad]", "", "Edit1")
MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3])
Cheers
Link to comment
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
 Share

  • Recently Browsing   0 members

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