ayatest Posted March 24, 2015 Share Posted March 24, 2015 Maybe this question is silly, but I'm still experimenting, and there are many things that I'm not sure how they work. So the question. Functions like WinGetPos - can be used multiple times like this? Local $variable1 = WinGetPos(something) Local $variable2 = WinGetPos(somethingelse) ... ? I mean - will variables remember these selections after the function is re-triggered on something else? functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general. Link to comment Share on other sites More sharing options...
l3ill Posted March 24, 2015 Share Posted March 24, 2015 (edited) Not silly at all. Local Variables stay in the function scope "so to speak" Here some good reading on the subject Edited March 24, 2015 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
JohnOne Posted March 24, 2015 Share Posted March 24, 2015 Yes. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
iamtheky Posted March 24, 2015 Share Posted March 24, 2015 (edited) I would say the question is only silly because it would have been quicker to just run those lines and check. Edited March 24, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
ayatest Posted March 24, 2015 Author Share Posted March 24, 2015 @boththose - few posts ago I had an ambiguous situation with variables, that sometimes worked, sometimes not, although it was wrong at all. Besides reading and understanding are two separate things; not everyone comes from typical programming industry. So I just wasn't sure whether something happens to variable's content when reusing the same function (like WinGetPos) in conjunction with other variables after it. When I want to fill some matrix of variables with different data - I wish these data stay there, and not change. Thanks for clarification. functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general. Link to comment Share on other sites More sharing options...
JohnOne Posted March 24, 2015 Share Posted March 24, 2015 If you set these variables in your own function (UDF) then by default the values are lost when the function goes out of local scope (returns) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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