While-schleife Unterbrechen

  • Hey, hab meine Funktion bisher in einem

    [autoit]

    While True
    ...
    WEnd

    [/autoit]


    eingebettet. Allerdings möchte ich, dass er den kompletten Inhalt der

    [autoit]

    While True
    ...
    WEnd

    [/autoit]

    Wieder von vorne ablaufen lässt, sobald der Wert

    [autoit]

    $test

    [/autoit]


    4 hat.

  • Damit setz ich doch nur den Loop fort, oder nicht?

    Ich möchte, dass er den Loop abbricht, und von vorne ausführt.

  • er hat schon Recht, ContinueLoop lässt den Loop von Vorne beginnen. Mit ExitLoop verlässt du den Loop

  • Wenn du den Loop noch einmal ausführen und danach erst beenden willst,
    kannst du
    Do - Until
    nehmen, und falls im Loop selbst
    $test = 4
    auftritt, die Loop-Bedingung True setzen und mit Continue-Loop nochmal von vorne starten.

    Ist aber ziemlich unschön und lässt sich bestimmt eleganter lösen,
    ist dann aber Problemspezifisch... ;)

    There are only 10 types of people in the world:
    Those who understand binary - and those who don't.