Hypertrophy Posted July 29, 2009 Share Posted July 29, 2009 Func GetInfo($value) $list = WinList("[CLASS:QWidget]") For $n = 1 To $list[0][0] Return $list[$n][0] Next EndFunc Would this function return all the windows that i got from WinList()? Could I use these windows that I got from WinList() with GetInfo($value)? Link to comment Share on other sites More sharing options...
Izebize Posted July 29, 2009 Share Posted July 29, 2009 It will return only the first window, because if you use Return statment then it exits from the function, and gives back the result wich is $list[1][0]. Link to comment Share on other sites More sharing options...
Hypertrophy Posted July 29, 2009 Author Share Posted July 29, 2009 (edited) I'm lost. Can you tell me how to return values from functions and use them in other parts of my code because I cannot understand the helpfile. I feel like I'm screwed because I'm trying to count the number of lines in a file for specific types of windows that are open. thats why i tried creating this function because I can't manually specify the file to count the lines from, it has do do it for each of those types of windows >_< Edited July 29, 2009 by Hypertrophy Link to comment Share on other sites More sharing options...
Rarst Posted July 29, 2009 Share Posted July 29, 2009 Return interrupts function and gives "outside" any value that it is executed with. You cannot execute multiply returns because the very first jumps out of function into place where it was called from. If you want to return few values you can store it in array and return that array. I am not sure what you are trying to do in example because you aren't using $value that you are passing to the function for anything. AutoIt tag at Rarst.net Link to comment Share on other sites More sharing options...
MilesAhead Posted July 29, 2009 Share Posted July 29, 2009 Just return the entire array Return WinList("[CLASS:QWidget]") My Freeware Page 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