Forum Discussion
mfoster711
2 months agoRegular Contributor
I modified the code to include some extra debugging and remove the infinite loop.
- There are two lines marked Example 1 and Example 2.
- I paused the script on the line marked Example 1 and clicked Stop, the script exits immediately.
- I paused on Example 2 and clicked Stop, the script seems to continue pressing when you review the log.
See below for logs from the two different runs.
class dummyClass:
@staticmethod
def DummyFunction():
Log.Message("DummyFunction")
try:
pass # Example 2 - Use breakpoint on this line and then click Stop Button. Scripts seems to keep running
return "some value"
except Exception as err:
Log.Error("DummyFunction Exception: "+str(err.args))
return ""
# This main function is designed to run endlessly until user presses Stop Button
def main():
try:
i = 0
while True:
Log.Message("Main. i="+str(i))
i += 1
return_value = dummyClass.DummyFunction()
if return_value != "":
pass # Example 1 - Use breakpoint on this line and then click Stop Button. Scripts exits immediately
aqUtils.Delay(60000, "Wait for a minute after performing work")
if i > 5:
break
else:
aqUtils.Delay(60000, "Wait for a minute")
except Exception as err:
Log.Error("Main Exception: "+str(err.args))