Jump to content

Redirect a script's flow


Recommended Posts

Is there any way to do this? Something like TimeInit and TimerDiff but TimerDiff should return the flow of the script to TimeInit. Is this possible? :P Cheers!

AdLibEnable()?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

maybe you tell us what you are trying to do (or show some code maybe) - or its a guessing game..?

At the moment, I don't want to do anything with it, but in the past few days I found many ocasions where it would've been very very helpful.

In my mind, a rough exampl looks like this:

HotKeySet("+!1", "CountDownFrom5")
HotKeySet("+!2", "CountDownFrom3")
HotKeySet("+!3", "CountDownFrom1")


$1 = Jumpgate1()
Msgbox(0,"","5")
Msgbox(0,"","4")

$2 = Jumpgate2()
Msgbox(0,"","3")
Msgbox(0,"","2")

$3 = Jumpgate3()
Msgbox(0,"","1")
Msgbox(0,"","0")

Func CountDownFrom5()
    JumpTo($1)
EndFunc

Func CountDownFrom3()
    JumpTo($2)
EndFunc

Func CountDownFrom1()
    JumpTo($3)
EndFunc

But where do you see the guessing game in a clear and direct statement (question) like "IS there anyway to redirect a script's flow?" ?

Link to comment
Share on other sites

NO. Autoit has NO GOTO. You could use functions and Loops instead.

HotKeySet("+!1", "CountDownFrom5")
HotKeySet("+!2", "CountDownFrom3")
HotKeySet("+!3", "CountDownFrom1")
While 1
Sleep(100)
WEnd

Func    Countd($count)
For $i = $count To 0 Step -1
Msgbox(0,"",$i)
Next
EndFunc

Func CountDownFrom5()
   Countd(5)
EndFunc

Func CountDownFrom3()
   Countd(3)
EndFunc

Func CountDownFrom1()
   Countd(1)
EndFunc
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

NO. Autoit has NO GOTO. You could use functions and Loops instead.

HotKeySet("+!1", "CountDownFrom5")
HotKeySet("+!2", "CountDownFrom3")
HotKeySet("+!3", "CountDownFrom1")
While 1
Sleep(100)
WEnd

Func    Countd($count)
For $i = $count To 0 Step -1
Msgbox(0,"",$i)
Next
EndFunc

Func CountDownFrom5()
   Countd(5)
EndFunc

Func CountDownFrom3()
   Countd(3)
EndFunc

Func CountDownFrom1()
   Countd(1)
EndFunc
Hm.. so the answer is no. Thank you. I know how to count, I gave that example for nobbe to understand what I was trying to say.
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...