Jump to content

is there goto in autoit?


Recommended Posts

  • Developers

In you earlier posted example an ExitLoop would do the job.

Jos

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

  • Developers

I just commented on your initial posted code.

You will have to post some code for me to be able to help out.

Jos

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

Func P()
    While 1
        _IENavigate($oIE, "webpage" & $vID)
        
        $oSrc = _IEBodyReadText($oIE)
        
        For $i = 1 to $B[0]
            If StringInStr($oSrc, $B[$i], 2) > 0 Then;something detected
                L("Encountered blacklisted site '" & $B[$i] & "', skipping. URL: " & $vID)
            EndIf
        Next
; do junk

$vID = $vID + 2
    WEnd
EndFunc

And $B is an array holding websites (it's entries are irrelevant, and are from a text file (split))

It should exit where it says "encountered black listed site"

I'm thinking of moving the $vID = $vID +2 to the front, I'm not really 100% sure what to do.

Edited by igotandrew
Link to comment
Share on other sites

  • Developers

To exit the for-next loop when the IF is true you just add the ExitLoop after line containing the L(...).

This will stop the for next loop but will stay within the While-Wend loop

Jos

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

There are many, many was to handle that

Func P()
    Local $pass
    
    While 1
        $pass = ""
        _IENavigate($oIE, "webpage" & $vID)

        $oSrc = _IEBodyReadText($oIE)

        For $i = 1 To $B[0]
            If StringInStr($oSrc, $B[$i], 2) > 0 Then;something detected
                ;L("Encountered blacklisted site '" & $B[$i] & "', skipping. URL: " & $vID)
                $pass = 1
            EndIf
        Next
        
        If $pass = "" Then
            ; do junk
        EndIf
        
        $vID = $vID + 2
    WEnd
EndFunc   ;==>P

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...