I read this in the FAQ about the old 'goto' function...
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
That above makes sense... but I do believe with the goto function you would be able to tell the script to 'goto another section' of the script, where as the while 1 = 1 loop will only loop whats within 'While' and 'Wend'...
with the old 'goto' function (i never used it) but im guessing you'd be able to acheive something similar to this:
:mylabel
...do something...
...and something else...
goto, :helpme
:helpme
...do something...
...and something else...
goto, :please
:please
...do something...
...and do something else...
goto, :helpme
Instead of looping from ":mylabel" to ":mylabel" like the example in the FAQ section... the script above actually tells the script to go from one loop to another loop... I want to know how to do this with the "While" function
I have read all through the Functions help file for anything relative towards what im in search of, but i cant find anything... I'm hoping that an expert on here can explain to me how to do the following without directing me back to the help file on the account of I'm totally new at this and have no idea...
Thanks
Help with "While"... the new 'goto'
Started by
reecedorward
, Apr 28 2012 01:35 AM
4 replies to this topic
#1
Posted 28 April 2012 - 01:35 AM
#2
Posted 28 April 2012 - 02:40 AM
reecedorward,
Why not create a custom function like:
Then whenever you need to call that portion of your script all you have to do is call it like so:
It's actually better than a GoTo call as old school programming used, since it runs the portion of needed script, then returns back to where it left off before.
Realm
Why not create a custom function like:
Then whenever you need to call that portion of your script all you have to do is call it like so:
It's actually better than a GoTo call as old school programming used, since it runs the portion of needed script, then returns back to where it left off before.
Realm
...and then we shall see if your insanity can be cured!______________________________________________________________________My Contributions: RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
#3
Posted 28 April 2012 - 02:53 AM
AH HA! Thanks Realm
That has helped a lot! I will give that a go and post the results in here when its done
Also, with the line Func _MyGoToFunction () ..... what are the end brackets for?
Cheers,
Reece
That has helped a lot! I will give that a go and post the results in here when its done
Also, with the line Func _MyGoToFunction () ..... what are the end brackets for?
Cheers,
Reece
#4
Posted 28 April 2012 - 03:31 AM
- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.
#5
Posted 28 April 2012 - 04:13 AM
reecedorward,
Remove the useless labels and gotos in your last example and you're left with a simple sequence of instructions, since there is no loop in your pseudo-code.
OTOH, what guys are suggesting is bad. A much better idea is to restructure the code to blocks and true functions.
Remove the useless labels and gotos in your last example and you're left with a simple sequence of instructions, since there is no loop in your pseudo-code.
OTOH, what guys are suggesting is bad. A much better idea is to restructure the code to blocks and true functions.
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQL tutorial (covers generic SQL, but most of it apply to SQLite as well)An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious workPCRE v8.32 regexp pattern documentation. AutoIt uses a slightly older version so that more advanced features are not all available.RegExp tutorial: enough to get started
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





