Sign in to follow this  
Followers 0
BigDaddyO

If Then EndFunc not working in new version

3 posts in this topic

I have been using this code all along and now I just installed the new 3.0.102 version of AutoIT and it does not like it any more.

Func Screenshot()
   $SEARCH = FileFindFirstFile("c:\ScreenShot*.jpg")  
   IniDelete($INIFILE, "ScreenShot", "Number")
   If $SEARCH = -1 Then EndFunc
   While 1
      $FIND = FileFindNextFile($SEARCH) 
      If @error Then ExitLoop
      IniWrite($INIFILE, "ScreenShot", "Number", $FIND)
   Wend
   FileClose($SEARCH)
EndFunc

The 4th line is no longer functioning and I don't understand why.


Share this post


Link to post
Share on other sites



It's never been valid, it was a bug that it didn't complain before. The keyword you want is Return, not EndFunc. See the helpfile for more.

Share this post


Link to post
Share on other sites

It's never been valid, it was a bug that it didn't complain before.  The keyword you want is Return, not EndFunc.  See the helpfile for more.

<{POST_SNAPBACK}>

Thanks,

That works, I never even knew about the Return function before.

Mike


Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0