GUI Button - function to stop executing the remaining script

GUI Button - function to stop executing the remaining script

blakestone
Collaborator Collaborator
1,012 Views
2 Replies
Message 1 of 3

GUI Button - function to stop executing the remaining script

blakestone
Collaborator
Collaborator
To jump out of LOOP you enter EXIT eg.


(
local a = true

for x = 1 to 1 do (
if (a == true) then exit
)
)


I am not sure how to jump out of a GUI Button Function eg.


(
local a = true

function my_function = (
if (a == true) then exitfunction ???
)
)


or


(
local a = true

on my_button pressed do (
if (a == true) then exitmy_button ???
)
)
0 Likes
1,013 Views
2 Replies
Replies (2)
Message 2 of 3

blakestone
Collaborator
Collaborator
ah... got it!


return() -- this works
return -- this doesn't and what i had previously tried *slap forehead*
0 Likes
Message 3 of 3

Steve_Curley
Mentor
Mentor
Not related directly with original question (exiting an on...do) - all functions in Maxscript which take no parameters must be called with empty parentheses.
gc()
clearListener()
etc etc.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes