Jump to content
Sign in to follow this  
Reinhardt1julian

run function without exiting loop

Recommended Posts

Reinhardt1julian

i have a hotkey set which will run a function, to add 1 to a variable. but i have a loop to show a tray menu, and let the items do something. when the hotkey is pressed, the loop ends.

Share this post


Link to post
Share on other sites
Nessie

Something like that:

$Flag = False
HotKeySet("{ESC}", "Terminate")

Do
    ConsoleWrite("a" & @CRLF)
Until $flag = True

Func Terminate()
    $flag = True
EndFunc

Hi!


My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites
kylomas

R1j,

Is this the problem?

when the hotkey is pressed, the loop ends.

If so, post the code...

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Reinhardt1julian

Global $a=0
HotKeySet("a", "_a")
Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
Local $A= TrayCreateItem("A")
TrayCreateItem("")
Local $B= TrayCreateItem("B")
TraySetState()
While 1
    Global $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $A
         MsgBox(0,"","A")
        Case $msg = $B
            Exit
    EndSelect
WEnd
Func _a()
    $a=$a+1
    Send("a")
EndFunc

Share this post


Link to post
Share on other sites
kylomas

Is this related to thread?

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Reinhardt1julian

It is.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×