Newbie2 Posted February 1, 2004 Share Posted February 1, 2004 Hello, I'm kind of new with AutoIt. I was wondering what this "Return" do. Thx For $myLoop=1 to 100 $var=1 If $var=1 Then MsgBox (0,"",$myLoop) Return EndIf Next Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2004 Developers Share Posted February 1, 2004 in this case it will have the same effect as Exit. Return is used in combination with Func...EndFunc below a portion of the helpfile example: msgBox(0,"Today is " & today()) Exit Func today();Return the current date in mm/dd/yyyy form return (@MON & "/" & @MDAY & "/" & @YEAR) EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jpm Posted February 1, 2004 Share Posted February 1, 2004 Hello, I'm kind of new with AutoIt. I was wondering what this "Return" do. Thx For $myLoop=1 to 100 $var=1 If $var=1 Then MsgBox (0,"",$myLoop) Return EndIf NextI am not sure the doc is perfect but it is better to have a look a it and you will find that the return is used inside Function (Func/EndFunc) so your case you should get an error message because there is no function defined Good luck in learning Link to comment Share on other sites More sharing options...
Newbie2 Posted February 1, 2004 Author Share Posted February 1, 2004 So Return (out of a function) is always similar to EXIT? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2004 Developers Share Posted February 1, 2004 (edited) nope.... Return in the Main section is the same as Exit. Return in a Func...EndFunc returns to the code that called it. Exit in a Func...EndFunc would stop the program. Edited February 1, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Newbie2 Posted February 1, 2004 Author Share Posted February 1, 2004 I GOT IT!! Thank you JdeB! 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