Sign in to follow this  
Followers 0
Kiti

about functions

15 posts in this topic




I know it's a VERY noob question, but how can I exit a function? :):P

Most functions will exit themselves after they are run or after you meet certain conditions so you don't really have to do anything. Exactly what function are you trying to exit?


Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]

Share this post


Link to post
Share on other sites

I know it's a VERY noob question, but how can I exit a function? :):P

Check out "Return" in the help file.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Most functions will exit themselves after they are run or after you meet certain conditions so you don't really have to do anything. Exactly what function are you trying to exit?

I've made a GUI, and tray button which runs the function which has the GUI inside. On the GUI, I want a button to exit that function (of displaying the GUI). GuISetState(@SW_HIDE), indeed hides the GUI, but I can't start it again from the tray, because it's not stopped, but hidden.

I simpy want a GUI that can be closed from the GUI windows itself, and started again from the tray menu.

Edit: SmOke_N, I didn't find any "Return" in the helpfile. :)

Edited by Kiti

Share this post


Link to post
Share on other sites

Edit: SmOke_N, I didn't find any "Return" in the helpfile. :)

Dunno which helpfile you use but its in mine when i look in the INDEX tab.

:P


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

Dunno which helpfile you use but its in mine when i look in the INDEX tab.

:P

Index tab? :)

Here? "C:\Program Files\AutoIt3\Examples\Helpfile" ?

Btw, it should be GREAT if the helpfile would be organized in subfolders like: GUI, WinApi, SQLite, GDIPlus, and so on. Anyone would go directly to what they need, without having to surf through 1.928 files. :P

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Index tab? :)

Here? "C:\Program Files\AutoIt3\Examples\Helpfile" ?

Btw, it should be GREAT if the helpfile would be organized in subfolders like: GUI, WinApi, SQLite, GDIPlus, and so on. Anyone would go directly to what they need, without having to surf through 1.928 files. :P

Nah.. you are looking at the wrong place for sure.

In SciTE hit F1 or open AutoIt.chm in the AutoIt3 program directory. :P

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

use the search function in the helpfile :)

Share this post


Link to post
Share on other sites

Btw, it should be GREAT if the helpfile would be organized in subfolders like: GUI, WinApi, SQLite, GDIPlus, and so on. Anyone would go directly to what they need, without having to surf through 1.928 files. :)

Like the contents are do you mean?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Nah.. you are looking at the wrong place for sure.

In SciTE hit F1 or open AutoIt.chm in the AutoIt3 program directory. :D

Jos

Wooow!!!! What a huuuge sorted help!! :)

Now I'll surely find what I want. :mad:o:)

"Like the contents are do you mean?"

What? :P Sorry, I didn't understood, please reformulate. :P

Edit: The return is not working. I want to exit a GUI, not to display a variable... Should I provide the script, so you'll better understand what I want to do?

Edited by Kiti

Share this post


Link to post
Share on other sites
Posted Image

Share this post


Link to post
Share on other sites

Edit: The return is not working. I want to exit a GUI, not to display a variable... Should I provide the script, so you'll better understand what I want to do?

Return does exit a Func.. 100% sure.

So what are you trying here ?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

Posted Image

brand new meaning to "want me to draw you a picture?" hehe


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#Include <Constants.au3>

Func _show()
Local $YesID, $ExitID, $msg
$gui = GUICreate("Custom Msgbox", 210, 80)
GUICtrlCreateLabel("Please click a button!", 10, 10)
$YesID = GUICtrlCreateButton("Validate!", 25, 40, 100, 30)
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $YesID
            ;my actual *long* script here
        Case $ExitID
            ;I just want to exit _show, so I can bring it up again using the tray button
        Case $GUI_EVENT_CLOSE
            ;same as above
    EndSwitch
WEnd
Endfunc

#NoTrayIcon
Opt("TrayMenuMode",1)

$display = TrayCreateItem("Display")
TrayCreateItem("")
$exit = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $display
        _show()
        Case $msg = $exit
            Exitloop
    EndSelect
WEnd

Exit

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#Include <Constants.au3>

Func _show()
Local $YesID, $ExitID, $msg
$gui = GUICreate("Custom Msgbox", 210, 80)
GUICtrlCreateLabel("Please click a button!", 10, 10)
$YesID = GUICtrlCreateButton("Validate!", 25, 40, 100, 30)
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $YesID
            ;my actual *long* script here
        Case $ExitID
            ;I just want to exit _show, so I can bring it up again using the tray button
        Case $GUI_EVENT_CLOSE
            ;same as above
    EndSwitch
WEnd
Endfunc

#NoTrayIcon
Opt("TrayMenuMode",1)

$display = TrayCreateItem("Display")
TrayCreateItem("")
$exit = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $display
        _show()
        Case $msg = $exit
            Exitloop
    EndSelect
WEnd

Exit
Case $ExitID
            GUIDelete($gui)
            Return

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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