Sign in to follow this  
Followers 0
golfinhu

how to exit script?

5 posts in this topic

this is a part of my script:

Opt("TrayMenuMode", 1)
$exit = TrayCreateItem("Exit")
TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = $exit
            ExitLoop

        Case Else
            TrayTip("Running", "O " & $title & " está em execução", 3)
            $logfile = OpenOrCreateLog(@ScriptDir & "\log xml.txt")
            DownloadFile($download_link, $file_name, $logfile)
            Verificar_Arquivo($file_name, $logfile)
            Space_tag($file_name, $logfile)
            Subst_ponto($file_name, $logfile)
            Arrumar_Pontuacao($file_name, $logfile)
            interrogacao($file_name, $logfile)
            break_line($file_name, $logfile)
            open_tag($file_name, $logfile)
            Convert($file_name, $logfile)
            Tidy($file_name, $logfile)
            $FTPsession = FTPSessionOpen('MyFTP Control', $logfile)
            $FTPconnect = FTPSessionConnect($FTPsession, $server, $username, $password, $logfile)
            If Not FTPSetRemoteDir($FTPconnect, '\httpdocs\jovial', $logfile) And FTPSessionClose($FTPsession, $logfile) Then Exit
            FTPSendFile($file_name, '\httpdocs\jovial\xml.xml', $FTPconnect, $logfile)
            FTPSessionClose($FTPsession, $logfile)
            FileDelete($file_name)
            If Not @error Then _FileWriteLog($logfile, "XML deletado - OK")
            _FileWriteLog($logfile, "----------------------------------------" & @CRLF & "Tudo Ok!")
            FileClose($logfile)
            TrayTip($title, "Finalizado!", 3)
            Sleep(1000)
            ExitLoop
    EndSelect
WEnd

people, can you help me?

what's wrong with this script?

because when I click "Exit" the program continues running

it just stops running when he finished completing all the tasks!

How can I when you click "Exit" to stop him running the same program?

thanks

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thanks, but...

it's dont work =/

but thanks for your help

I've had similar issues, I think its just busy running the code and dosent register the exit until its finished.

I find that setting a hotkey for exit function works more quickly.

HotkeySet?

Edited by golfinhu

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

HotKeySet("^!{ESC}", "Quit") ;Ctrl+Alt+Esc

Func Quit()
    Exit
EndFunc   ;==>Quit
Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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