GodForsakenSoul Posted January 16, 2010 Share Posted January 16, 2010 (edited) moving between functions in autoit is like moving your pieces in chess. there are set rules.i made a map of how my function goes.the green line goes top-down and left-right. like the in stop lights, green means OK.what i need is to make the RED move. as in, under certain circumstances in FUNCLoopTill(), i go back to GUIPKan().as you may have guessed, i'm stumped here.help? Edited January 16, 2010 by GodForsakenSoul Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2010 Moderators Share Posted January 16, 2010 GodForsakenSoul,Either let the FUNCComKana() function finish naturally or use Return at the point(s) where you want to get back along your red line. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted January 16, 2010 Author Share Posted January 16, 2010 GodForsakenSoul,Either let the FUNCComKana() function finish naturally or use Return at the point(s) where you want to get back along your red line. M23uh... the return business i don't understand.... the help file produces a large chunk of code.FUNCLoopTill(), as the name suggest, is basically a switch which reads a key from an ini file, compares it to another key, and if the keys match, exits. i forgot to make a line to Exit there...FUNCLoopTill() doesn't have any valueable output to justify a Return().hell, it doesn't have ANY output. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 16, 2010 Share Posted January 16, 2010 What? You need to let your functions end naturally or with Return as Melba said, nothing less, nothing more. Just do it. And you can't blaim the helpfile, just download it again if it's broken or check the online ones. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2010 Moderators Share Posted January 16, 2010 (edited) GodForsakenSoul,Does this make Return any clearer? #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hButton = GUICtrlCreateButton("Test", 10, 10, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton ConsoleWrite("Going into the function" & @CRLF) Function() ConsoleWrite("Returned from the function" & @CRLF) EndSwitch WEnd Func Function() For $i = 1 To 5 ; This shows that the function is progresing ConsoleWrite($i & @CRLF) ; Let us return early - if $i = 3, we leave now!!!! If $i = 3 Then Return Next ; If you comment out the If line above, you will get here and return automatically EndFuncM23Edit: Speeling Edited January 16, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted January 17, 2010 Author Share Posted January 17, 2010 so.... Return() ends the function early, basically? kinda like ExitLoop only for functions? Link to comment Share on other sites More sharing options...
AlmarM Posted January 17, 2010 Share Posted January 17, 2010 (edited) so.... Return() ends the function early, basically?kinda like ExitLoop only for functions?Return makes ur function return a value. Or @Melba's example, make it stop earlier. Edited January 17, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted January 17, 2010 Author Share Posted January 17, 2010 Return makes ur function return a value. Or @Melba's example, make it stop earlier.yes, precisely. i ment in Melba's example.Does it work like a function equivalent of ExitLoop? Link to comment Share on other sites More sharing options...
AlmarM Posted January 17, 2010 Share Posted January 17, 2010 Look at Melba's example to see how to exit a function earlier, what I ment was this: $GUI = GUICreate("Test", 100, 100) $Button = GUICtrlCreateButton("Test", 10, 10) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $Button $Func = MyFunc() MsgBox(0, "", "$Func returned: " & $Func) EndSwitch WEnd Func MyFunc() Return "Wieeeeee" EndFunc Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 17, 2010 Developers Share Posted January 17, 2010 yes, precisely. i ment in Melba's example.Does it work like a function equivalent of ExitLoop?Did you get some sleep yet?After you have done that, try taking the time to do a little reading when people make suggestions in an effort to understand what is proposed.You are here long enough to understand this much ... right ?Now get everything of your setup fixed and open the helpfile before asking or else we will help you take the time for reading. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2010 Moderators Share Posted January 17, 2010 GodForsakenSoul,Does it work like a function equivalent of ExitLoop?It is not how I would describe Return, but it is not too far from the truth. However, Return is, as AlmarM hinted, more powerful as it can return values to help your decision making once the function ends.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now