Jump to content

Do.. Until Problem


Recommended Posts

I'm trying to make a script using a Do, Until loop, however, when ever I try to run the script in AutoIt 3, i get an error saying "'Until' statement with no matching 'Do' statement."

However, I do have a Do statement.

heres my script:

$r = 0;

Do

Send("!1");
sleep(10000);

Send("!5");
Sleep(10000);

Send("!2");
Sleep(10000);

Send("!5");
Sleep(10000);   

$r = $r + 1;

if $r = 15 then

Send("h");
sleep (1200000);
Send("h");

Until $r = 1000

Any ideas?

Thanks

Link to comment
Share on other sites

I'm trying to make a script using a Do, Until loop, however, when ever I try to run the script in AutoIt 3, i get an error saying "'Until' statement with no matching 'Do' statement."

However, I do have a Do statement.

heres my script:

$r = 0;

Do

Send("!1");
sleep(10000);

Send("!5");
Sleep(10000);

Send("!2");
Sleep(10000);

Send("!5");
Sleep(10000);   

$r = $r + 1;

if $r = 15 then

Send("h");
sleep (1200000);
Send("h");

Until $r = 1000

Any ideas?

Thanks

You forgot "EndIf".
Link to comment
Share on other sites

  • Developers

This is were Tidy.exe come in handy: :D

Tidy output:
$R = 0;

Do
   
   Send("!1");
   Sleep(10000);
   
   Send("!5");
   Sleep(10000);
   
   Send("!2");
   Sleep(10000);
   
   Send("!5");
   Sleep(10000); 
   
   $R = $R + 1;
   
   If $R = 15 Then
      
      Send("h");
      Sleep(1200000);
      Send("h");
      
;### Tidy Error: Level error -> Until is closing previous if
   Until $R = 1000

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

not sure what you mean with tidy.exe, but the "EndIf" fixed it.. thanks

Tidy is a utility that Tidy's the script source by indenting the source properly and also checks for errors like you had...

Look for tidy in the scrips and scraps forum....

Its also part of the Scite Editor install set.

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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