Guest ScottD Posted January 24, 2005 Posted January 24, 2005 Just installed AutoIt and am giving it a test drive. Very cool so far, however, I'm getting an error when trying to use array vars. This code from the help: Dim $pos[4] $pos = ControlGetPos("Untitled - NotePad", "", "Edit1") MsgBox(0, "Window Stats:", "POS: " & $pos[0] & _ "," $pos[1] & " SIZE: " & $pos[2] & "," $pos[3] ) This gives me an error: Error: Subscript used with non-Array variable. I've reinstalled AutoIt, but to no avail. What stupid little thing am I doing wrong? Also, is there a way to click the currently active control, something like ActiveControlClick? Thanks for any help!
tamir Posted January 24, 2005 Posted January 24, 2005 it's not a problem with autoit, u jst don't have a window with the title "Untitled - NotePad" open...and btw, the expression in the msgbox is wrong, u forgot few &'s. here's the fixed expression:MsgBox(0, "Window Stats:", "POS: " & $pos[0] & _ "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )
CyberSlug Posted January 24, 2005 Posted January 24, 2005 Your array indices look fine...check the title "Untitled - NotePad"I think the title is case sensitive and causes the ControlGetPos to fail. You should always check @error, or you could actually check IsArray($pos)$pos = ControlGetPos("Untitled - NotePad", "", "Edit1") MsgBox(4096,"info", "Error code: '" & @error) $pos = ControlGetPos("Untitled - Notepad", "", "Edit1") MsgBox(4096,"info", "Error code: '" & @error) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Guest ScottD Posted January 24, 2005 Posted January 24, 2005 Thanks, guys. A couple extra ampersands and a lower-case 'p' did the trick. :">
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now