Loop neben Loop

  • Hey, ich habe einmal meine Standartfunktion, die immer wieder abläuft. Der Inhalt ist "abc"

    Also

    [autoit]

    While True
    abc
    WEnd

    [/autoit]

    Wenn aber das Fenster "Google - Mozilla Firefox" existiert, soll die Standartfunktion wieder von vorne abspielen. Hatte also dafür im gleichen Script noch folgenden Loop geschrieben:

    [autoit]

    While True
    If WinActive ("Google - Mozilla Firefox" Then
    ContinueLoop
    EndIf
    WEnd

    [/autoit]

    Aber das ContinueLoop bezieht sich ja so auf den Loop, der mit der Standartfunktion nichts zu tun hat, deswegen funktioniert das ja in der Form nicht.
    Wie kann ich das umschreiben, dass er, wenn das Fenster "Google - Mozilla Firefox" aktiv ist, den Loop neustartet?

  • Ich habe keine Ahnung ob das geht, wenn man zwei Loops ineinander packt, aber so könnte ichs mir vorstellen

    Spoiler anzeigen
    [autoit]

    While True

    [/autoit] [autoit][/autoit] [autoit]

    While True
    abc
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    If WinActive ("Google - Mozilla Firefox" Then
    ContinueLoop
    EndIf
    WEnd

    [/autoit]


    Eventuell ist dies eine dumme Antwort (Siehe Signatur) 8|

  • Schreib dein ABC-Loop in eine Funktion und ruf diese in der andren Schleife auf..

    oder wahlweise:

    Spoiler anzeigen
    [autoit]

    While 1
    If WinActive ("Google - Mozilla Firefox") Then
    ExitLoop
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    abc
    WEnd

    [/autoit]