Jump to content
Sign in to follow this  
zasxes

How Do I Use Exitloop In A Function

Recommended Posts

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

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

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.
  :)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...