Jump to content

Stopping Loop


Recommended Posts

guys here is my code

The problem is i dont know how to get the script not to exit but stop on a certain event.

If ProcessExists("sam.exe") Then

If this processexists i want it to display a msg box telling them a program is open which works fine, but after they click OK on the msg box i need it to return them to the main GUI window?

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $current
        _ANIREAD()
    Case $msg = $Jeff
        $ani2 = FileReadLine( "c:\windows\ani.ini", 3 )
        $var2 = StringInStr($ani2, "z")
        If $var2 Then
            $var3 = 1
        Else
            $var3 = 0
        EndIf

        If ProcessExists("sam.exe") Then
            MsgBox(0, "Error", "Please Close Sam before Switching agents.")
            Exit
        ElseIf ProcessExists("paris.exe") Then
            MsgBox(0, "Error", "Please close paris before switching agents.")
        EndIf
        
        If $var3 = 1 Then
            MsgBox(0, "Error", "Your currently viewing Jeff's Paris/Sam.")
        EndIf
Case Else
    ;;;;;;;
    EndSelect
WEnd
Link to comment
Share on other sites

  • Moderators

Just remove the Exit from under the MsgBox()

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.

Link to comment
Share on other sites

If i do an exitloop it terminates the script doesnt go back to main gui

If i take the exit out it continues on to the next if which i dont need it to do

i need it to go back to the main gui if that process exists

Edited by anyday
Link to comment
Share on other sites

uhhh

ContinueLoop?

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

  • Moderators

If i do an exitloop it terminates the script doesnt go back to main gui

If i take the exit out it continues on to the next if which i dont need it to do

i need it to go back to the main gui if that process exists

Ahh, yes then... cdkid got it on the nose... I didn't know that wasn't your main loop.

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.

Link to comment
Share on other sites

If you are new to AutoIT and would like to get the basics down quicker, check out this awesome new coaching tool...

And if you find it useful ...vote :)

http://www.autoitscript.com/forum/index.php?showtopic=24117

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

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...