how can i stop a loop?
Professional Software Development Tools
how can i stop a loop?
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
Take a look at using break in AMS as well.
Intrigued
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
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
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.
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
i wont to stop a loop whit a stop button
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.