cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Full script stop

OI_8877786
3-Newcomer

Full script stop

Hello, how can I implement a complete stop of the script so that, under some condition, the script is not interrupted, not paused, namely, it stops working (I take into account that the script is launched once, without using Autorefresh). The script is not cyclical, a full stop could happen at any moment of the script execution.

ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:OI_8877786)

What is the actual use case?

It is very rare that you would just 'stop' a script.

Often you would use if/then/else statements (perhaps with some properties to see which way execution should go)

or if you are doing a loop you would use 'break'

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:OI_8877786)

What is the actual use case?

It is very rare that you would just 'stop' a script.

Often you would use if/then/else statements (perhaps with some properties to see which way execution should go)

or if you are doing a loop you would use 'break'

DanZ
15-Moonstone
(To:OI_8877786)

You can use a self executing function to encapsule you whole service and then use a return statement to stop it whenever you want.

 

const result = (function() {
    // Your service code
})();

 Or if you prefer the arrow notation:

const result = (() => {
    // Your service code
})();

 

Announcements


Top Tags