Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2005
    Posts
    572

    how can i stop a loop

    how can i stop a loop?

  2. #2
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    Hit Ctrl+Alt+Delete
    Then in Task Manager, close the offending application.

    Then take a look at your code and change your conditional.

    What I’m saying is that each time through the loop, your code should be checking if some condition is met. If the condition is not met, you go back through the loop, if the condition is met, you break out of the loop.
    Conditionals you might use are:
    if/then
    while

    Check out (Search) for Control Structures in the Help file.

    HTH
    Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
    Visit Acme-Tek

  3. #3
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Take a look at using break in AMS as well.
    Intrigued

  4. #4
    Join Date
    Jun 2000
    Location
    Indigo Rose Software
    Posts
    1,943
    Hi Ind,

    Perhaps you were looking for something like a semaphore?

    As JimS and Intrigued have mentioned there are many different ways to break out of a loop in AutoPlay, the decision is mostly dependent on what you are doing and what you are trying to accomplish.
    MSI Factory The Next Generation Intelligent Setup Builder

  5. #5
    Join Date
    Oct 2005
    Posts
    572

    way the break dont work

    way the break dont work?
    27 is "Esc"

    for i = 1, 1000000 do
    Label.SetText("Label1", i);
    if e_Key == 27 then
    break;
    end
    end

  6. #6
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Once you are in the loop, there is nothing allowing the system to look for the keypress. A loop will only run the code within itself. Your checking the e_Key value, but the loop is already running, therefore the e_Key is never updated.

  7. #7
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    I would suggest you explain what you are trying to do exactly and the fellas and gals here will surely fire off some suggestions, workarounds.
    Intrigued

  8. #8
    Join Date
    Oct 2005
    Posts
    572

    i wont to stop a loop whit a stop button

    i wont to stop a loop whit a stop button

  9. #9
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Once you're in the loop, the AMS interface is disabled as the loop has total focus. If you can use the Timer to do the loop, you are better off as it doesn't hold the app hostage. You could use the code below in your loop to break out with an Escape Key press.

    Code:
    for n=1, 10000 do
    	if System.IsKeyDown(27) then
    		break
    	end
    	Application.Sleep(1)
    end
    Last edited by Worm; 09-28-2006 at 10:01 AM.

Similar Threads

  1. loop problem & RTL problem
    By lnd in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 09-27-2006, 07:38 AM
  2. A little tricky loop question
    By AnubisTCP in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 05-23-2006, 03:09 PM
  3. Unusual sound effect with a loop.
    By longedge in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 02-07-2005, 05:59 PM
  4. How to control loop time on this code?
    By pierre in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 04-29-2004, 07:02 AM
  5. Replies: 14
    Last Post: 06-24-2003, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts