Jump to content

Sleep problems


AdamRo
 Share

Recommended Posts

Hi,

I am fairly new to AutoIt() but have a few years of experience with Automation in general. I am trying to debug a developer's script and have narrowed the problem down to the Sleep calls. For some reason when the script reached the Sleep call it ends the script.

Example:

----------------------------

For $nIndex = 0 to 100

Sleep(1000)

ConsoleWrite(".")

Next

----------------------------

This code will immediately exit without printing any '.' while I would expect a '.' to appear every second for 100 seconds.

----------------------------

For $nIndex = 0 to 100

;Sleep(1000)

ConsoleWrite(".")

Next

----------------------------

Commenting out the Sleep I will see 100 '.' on the console and the app will end.

Does anyone have any clue what is wrong here?

Thanks,

Adam

Info:

Using SciTE4AutoIt3 Version 1.71

AutoIt() v3.2.2.0

Windows XP Pro

Windows application scripting

Link to comment
Share on other sites

Works ok for me, try updating to the latest version of AutoIt


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Works ok for me, try updating to the latest version of AutoIt

Yeah I'm sure it's a configuration issue or something. I have the same version installed on another PC and it works fine, well the script is still buggy but not because of AutoIt(). I installed it on this system this morning (newer/faster PC) and started having this problem. I installed a newer version of AutoIt() from the site but there were far too many errors from already defined variables and changes to the API ( I gather ) so I uninstalled it and reinstalled this one. Same problem.

Any known PC compatibility issues?

System used: Dell Precision 380

Link to comment
Share on other sites

[i did not write the original code, just trying to debug it now]

So the problem appears to be eminating from a debug function/tool "AdlibEnable".

Within the function it calls, there are a series of If Then calls to see if an error message is present or not in which case it seems to just log the message and exit the script. If none of the error messages are found it simply returns. For some reason when it encounters a Sleep of any kind it immediately exits. I can't seem to grasp why, but if I comment this AdlibEnable the script will run and Sleeps will execute as expected.

Does this ring any bells to anyone or am I simply missing something very obvious?

Thanks,

Adam

Link to comment
Share on other sites

Can you make a small example that shows how it is breaking?

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

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