Jump to content
Sign in to follow this  
Tarawa

Do.. Until Problem

Recommended Posts

Tarawa

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
SlimShady

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
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Tarawa

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

Share this post


Link to post
Share on other sites
Jos

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

×