jessegk Posted January 9, 2007 Share Posted January 9, 2007 Say I have $Variable = 1000 How would I format Sleep so that it uses the variable. So instead of going: Sleep (1000) it would be something like: Sleep ($Variable) You know what I mean. Thanks. Link to comment Share on other sites More sharing options...
Zedna Posted January 9, 2007 Share Posted January 9, 2007 Yes it's right. Just it it for yoursself: $i = 3000 consolewrite(1) Sleep($i) consolewrite(2) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
jessegk Posted January 10, 2007 Author Share Posted January 10, 2007 Yes it's right. Just it it for yoursself: $i = 3000 consolewrite(1) Sleep($i) consolewrite(2) Thanks for the reply. It worked fine. I guess I had a typo or something somewhere when I tried this earlier. Again, thanks! Link to comment Share on other sites More sharing options...
ThaSatelliteGuy Posted January 10, 2007 Share Posted January 10, 2007 I also have used it with a multiplier to compensate for slower machines For instance througout the prog I might need different Sleep times: Instance A: Sleep(1000) 1 sec Instance B: Sleep(2000) 2 sec Instance C: Sleep(3000) 3 sec If I want a user to be able to select his machine speed and it propagate throughout the program differently in different places, but yet proportionally I do this: $M = 'Get this from the user-- ie: InputBox (Maybe store it in registry for later) maybe give a choice of 1 to 10, 10 being slowest Then: Instance A: Sleep(1000 * $M) Instance B: Sleep(2000 * $M) Instance C: Sleep(3000 * $M) Now If $M = 4 Then Instance A: Sleep(1000 * $M) is 4 sec Instance B: Sleep(2000 * $M) is 8 sec Instance C: Sleep(3000 * $M) is 12 sec 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