Uten Posted August 25, 2008 Share Posted August 25, 2008 (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 August 25, 2008 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Nevin Posted August 25, 2008 Share Posted August 25, 2008 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 25, 2008 Moderators Share Posted August 25, 2008 (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 August 25, 2008 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 More sharing options...
monoceres Posted August 25, 2008 Share Posted August 25, 2008 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! Link to comment Share on other sites More sharing options...
youknowwho4eva Posted August 25, 2008 Share Posted August 25, 2008 Without running it I would say that would error, just tested, no error. I just assumed it wouldn't like the "and Assign". Giggity Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now