Notifications
Clear all

[Closed] How to stop running MaxScript

Hi to all,

I have run several times into troubles with maxscript. I have been coding some DO … WHILE function and I made a misstake, so the script was running in endless cycle.

Is there a way how to break the execution of the scipt??? ( something like CTR+Break … )

thanx for all answers

Zajo

3 Replies

the key Esc will stop the maxscript.

press Esc and the listener will print

** interrupted **

failing that,

if you run into situations when esc wont work you can build into your routine a function to look for a file, that you then delete when you want the script to stop. not for production but can help in testing.

J.

Hi,

A good way to break a while loop is to set it’s test expression to true after a certain amount of time has passed, as in:

local intCount = 100
local s = timestamp()
while (intCount > 0) do
(
– DoStuff()
– if the loop doesn’t complete its process in 3 seconds, break!
if ((timestamp()) – s) / 1000 > 3 do intCount = 0
)

Light