Sign in to follow this  
Followers 0
russell

Prob a dumb question

11 posts in this topic

I have several scrips broken and referenced back and forth upon different situations, is there a GOTO function that i could use instead? It would see that it would help out alot. Like

to goto another line in the script


muppet hands are so soft :)

Share this post


Link to post
Share on other sites



i did and i get results like global and such, nothing i cant find pertaining to goto


muppet hands are so soft :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

From Help file -> AutoIt -> Frequently Asked Qestions (FAQ) -> #4:

4. Where is the "goto" command?

Gone. It's evil. No, you can't ask why - it just is. It's like that lump of rock they find in the microwave at the end of the film <a class="ext" href="http://www.imdb.com/title/tt0081633/">Time Bandits ;)

AutoIt v3 features most of the common "loops" in use today and with these Goto is no longer required. Look up While, Do, For, ExitLoop, ContinueLoop and Functions for the modern way of doing things :) And while you are looking at help file sections check out these on loops, conditional statements and functions. I promise you, once you have got the hang of such things you will be able to script in virtually any other language within a couple of minutes.

Just to get you started, the most basic use of Goto in version 2.64 was an infinite loop like:

:mylabel

...do something...

...and something else...

goto, mylabel

A simple v3 version of that is a While loop that is always "true".

While 1 = 1

...do something...

...do something else...

Wend

BTW First result found after typing "goto" in the search box ...

Edited by whim

Share this post


Link to post
Share on other sites

That is where the programmer's logic must prevail. You need to figure out the logic by sketching a Gannt chart to make your script work. If you post code/relevant details we may be able to help you out.

Share this post


Link to post
Share on other sites

I think people ought to remember we are not all programmers here.. some off us are just ordinary people trying to make our lives easier

sketching a Gannt chart??? ;) i had to check google to see what it was!!

ps not trying to cause offence

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I think people ought to remember we are not all programmers here.. some off us are just ordinary people trying to make our lives easier

sketching a Gannt chart??? ;) i had to check google to see what it was!!

ps not trying to cause offence

The main idea here is to visualize your scrnipt. I am not a programmer per se, rather I create scripts to automate my needs. The gannt chart may be more formal than what you need, but it us good practice for more complicated scripts. Understanding logic is the key to success. Edited by Varian

Share this post


Link to post
Share on other sites

my best bet for you is try to utilize the use of ContinueLoop, ExitLoop and Return command ;)

Share this post


Link to post
Share on other sites

Well you have cleared up for me that there is no GOTO. I miss it :graduated: but do understand what you all are speaking of. My mind has over the past two weeks worked its way into seeing the scrit like scymatics and the order in which thing happen. In a way im glad they removed it so my "pratice" isnt tainted


muppet hands are so soft :)

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