apsync Posted May 6, 2005 Posted May 6, 2005 can I do -> If $MODE = 1 Then While $S < 5 ElseIf $MODE = 2 Then While $S < 10 EndIf MsgBox(0, "..", "...") Wend in C++ there is #ifdef , #ifndef, #define etc for this, when you use that the compiler ignores that part of code, can this also be done in AutoIt, if yes, what functions thx
Nutster Posted May 6, 2005 Posted May 6, 2005 can I do ->If $MODE = 1 Then While $S < 5 ElseIf $MODE = 2 Then While $S < 10 EndIf MsgBox(0, "..", "...") Wendin C++ there is #ifdef , #ifndef, #define etc for this, when you use that the compiler ignores that part of code, can this also be done in AutoIt, if yes, what functionsthx<{POST_SNAPBACK}>Nothing currently implented. Even in C/C++, this is usually considered poor form. It would be better to do this:If $MODE = 1 Then While $S < 5 MsgBox(0, "..", "...") Wend ElseIf $MODE = 2 Then While $S < 10 MsgBox(0, "..", "...") Wend EndIf David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
confidentstrategery Posted May 6, 2005 Posted May 6, 2005 Or, maybe decide the stopping index first, and then execute the while loop. Something like this: If $MODE = 1 Then $iStop = 5 ElseIf $MODE = 2 Then $iStop = 10 EndIf While $S < $iStop MsgBox(0, "..", "...") Wend
Nutster Posted May 6, 2005 Posted May 6, 2005 Or, maybe decide the stopping index first, and then execute the while loop. Something like this:If $MODE = 1 Then $iStop = 5 ElseIf $MODE = 2 Then $iStop = 10 EndIf While $S < $iStop MsgBox(0, "..", "...") Wend<{POST_SNAPBACK}>Yup, this is better. You still need a way to change $S so that you can stop. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
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