Alan S Posted August 9, 2006 Share Posted August 9, 2006 Hi all, I'm very new to scripting in general and AutoIt3 in particular. I've got a syntax problem that is foxing me, and I just can't see it. I've searched the Help file, and this forum, to no avail. Basically, I'm saving a window size, resizing the window, then later resetting it. The following code shows the things I've tried: #include <Array.au3> Dim $WSArray [2] ; ; Open application here with RUN function WinWaitActive ("Window Title") ; ;save window size for later $WSArray = WinGetClientSize ("") ; ;display window size _ArrayDisplay( $WSArray, "Window Size" ) ; ; set new window size WinMove ("","",0,0,1024,738) sleep(1000) ; ; now reset window size ; first attempt fails: Error in Expression WinMove ("Window Title","",0,0,$WSArray(0),$WSArray(1)) ; ; second try - convert to number? Same error occurs WinMove ("Window Title","",0,0, number($WSArray(0)), number($WSArray(1))) ; ; Help? The $WSArray contains numbers, as shown by the _ArrayDisplay function, so I'm not sure why WinMove is barfing on either version of the code... all help gratefully received. Thanks, AlaN S> Link to comment Share on other sites More sharing options...
GaryFrost Posted August 9, 2006 Share Posted August 9, 2006 use [ ] instead of () for arrays #include <Array.au3> Dim $WSArray [2] $title = "Untitled - Notepad" ; ; Open application here with RUN function WinWaitActive ($title) ; ;save window size for later $WSArray = WinGetClientSize ($title) ; ;display window size _ArrayDisplay( $WSArray, "Window Size" ) ; ; set new window size WinMove ($title,"",0,0,1024,738) sleep(1000) ; ; now reset window size ; first attempt fails: Error in Expression WinMove ($title,"",0,0,$WSArray[0],$WSArray[1]) ; ; second try - convert to number? Same error occurs WinMove ($title,"",0,0, number($WSArray[0]), number($WSArray[1])) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Alan S Posted August 9, 2006 Author Share Posted August 9, 2006 Doh! Just call me Homer. I said I couldn't see it, didn't I? very many thanks.. Link to comment Share on other sites More sharing options...
System Tester Posted August 9, 2006 Share Posted August 9, 2006 Like you, I'm new to all this - Use the SciTe editor! Worth it's weight in gold! The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
Bert Posted August 9, 2006 Share Posted August 9, 2006 SciTe Rocks! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
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