Sign in to follow this  
Followers 0
Tarawa

Do.. Until Problem

5 posts in this topic

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

Share this post


Link to post
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".

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0