- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2021 11:50 PM
Hi All
Need a small help to understand as to where should I apply "break" statement, so that within the mainfunction(), once if condition gets executed it breaks out entirely out of the mainfunction()
Need to make sure it doesn't hamper the flow of the mainfunction() after the if condition is executed.
Can something be done in the name() ?
//Main Function
mainfunction(){
....
....
....
if( condition ) {
this.__name();
break; // Here Will it work?
}
.....
.....
......
}
__name: function(){
//perform some actions
}
Thanks and Regards
Saurabh Chatterjee
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 08:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 01:02 AM
if(yourcondition)
return;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 08:01 AM
Thank you Upender!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 02:00 AM
Hi,
Please check below code
function counter (count)
{
for(var i=0;i<parseInt(count);i++)
{
if(i==5)
{
return;
}
gs.print(parseInt(count)+"::"+i)
}
}
counter(18);
It will only print index upto 4
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
Regards,
Saurabh
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 08:00 AM
Thank you Saurabh!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 08:05 AM
Hi,
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
Regards,
Saurabh
Thanks and Regards,
Saurabh Gupta