Jump to content

Code quiz


Uten
 Share

Recommended Posts

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

  • Moderators

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.

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