Jump to content

Recommended Posts

Posted (edited)

Answer the pol without cheating please..;)

Will this piece of code execute one or more times? (Don't cheat by testing)

Local $c
Do
    $c += 1
    ConsoleWrite("Run nr " & $c & @crlf)
    sleep(1000)
Until (NOT True) OR $c=3

EDIT: uh, what happened to the pol? Cant get it going. So any explanations to the behavior?

Edited by Uten
Posted

I'm rusty on these things with AutoIt but wouldn't "NOT True" read as "not equal to 1"?

I guess it depends on the language. Then it would run twice.

  • Moderators
Posted (edited)

Answer the pol without cheating please..;)

Will this piece of code execute one or more times? (Don't cheat by testing)

Local $c
Do
    $c += 1
    ConsoleWrite("Run nr " & $c & @crlf)
    sleep(1000)
Until (NOT True) OR $c=3

EDIT: uh, what happened to the pol? Cant get it going. So any explanations to the behavior?

It will run until $c equals 3, so 3 loops, even though you didn't give the initialization variable $c a value, it still equals zero, so it would actually loop 3 times.

Edit:

I should say, it will run through the loop 3 times, it actually should only loop twice.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Heh, fun idea ;)

How many times will this loop iterate?

Local $a=0
Do
    $a+=1
Until $a=10 And Assign("a",$a+1)

Broken link? PM me and I'll send you the file!

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
×
×
  • Create New...