bbaffert Posted March 8, 2005 Share Posted March 8, 2005 I'm real new to autoit, and to be honest - just as new to programming. I've had a bit of success with autoit and have made a few small working scripts. I'm trying something a bit more elaborate and am stuck - maybe someone can help me. Basically, I call a function called GetSunColor from a weather site. Depending on the color, I assign the variable $sun either 1,2,3,4 The problem is, once the function is executed and returns to the main part of the script, the value of $sun is not retained. When I ran a seperate script just scanning the color of the sun on a webpage, I did get the exact colors and confirmed that the function was assigning the variable. However, once I implemented the function, the variable loses the value that was just placed into it. Hope this is enough info - I appreciate any help. Thanks Link to comment Share on other sites More sharing options...
Andre Posted March 8, 2005 Share Posted March 8, 2005 Hi, When u ask such a question always post your script (or the part that fails) so that people can help u Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
phillip123adams Posted March 8, 2005 Share Posted March 8, 2005 Basically, I call a function called GetSunColor from a weather site. Depending on the color, I assign the variable $sun either 1,2,3,4The problem is, once the function is executed and returns to the main part of the script, the value of $sun is not retained.<{POST_SNAPBACK}>This souonds like you need to dimension the $sun variable as GLOBAL. See the DIM function in the help file. Phillip Link to comment Share on other sites More sharing options...
igmeou Posted March 8, 2005 Share Posted March 8, 2005 As to me, it seems like you are not passing your variable correctly. Try reading the AutoIt Help on "Func" and take note of the "ByRef" keyword and use it when necessary. If you attach your code with the post it should be better for us to help. Take care. [font="Arial"]Thanks[/font]If @error = me Then $sorry Else Do $clarifyMe Until $meClear EndIF MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever) 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