Sign in to follow this  
Followers 0
zasxes

How Do I Use Exitloop In A Function

2 posts in this topic

I want to do something like this but it errors out

;$A is set above

WHILE $b < 10

JUMPOUT()

;Do Stuff not listed

$b=$b+1

WEND

FUNC JUMPOUT()

IF $A=1 Then

;Do Stuff not listed

EXITLOOP

ENDIF

ENDFUNC

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You can only do an exitloop within a loop.

You are trying to do an exitloop in a function...

someting like this would work:

$A is set above
While $B < 10 
   if JUMPOUT() = 1 the ExitLoop
  ;Do Stuff not listed
   $B=$B+1
Wend

Func JUMPOUT()
   If $A=1 Then
    ;Do Stuff not listed
      Return ( 1) 
   EndIf
   return (0)
EndFunc  ;==>JUMPOUT
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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