Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
Javascript

Control Break Statement

Break:

Break statements exits the control out of the closing brackets.

Example:

clip_image001

The for loop breaks after the count becomes 3. Break keyword is similar to that of Exit keyword in ABAP and it terminates the loop pass unconditionally. The remaining execution of the loop are not continued further after triggering break keyword. In above example the loop pass us not carried out the fourth and fifth time.

Continue:

Continue keyword is similar to that of continue keyword in ABAP and it terminates the loop pass only for the satisfied condition. The remaining execution of loop continues further.

clip_image002

Using labels to control the flow:

We can specify labels in the program and control the sequence of execution. This concept is not there in the ABAP.

We create a label by specifying the name before the loop pass starting and then control the execution back to the point where the label is created. This is specifically used when there is a loop inside a loop.

Example:

clip_image004

About Arun

3 Comments:

  1. Excellent…Amazing…. I’m satisfied to find so many helpful information here within the put up,for latest php jobs in hyderabad. we want work out extra strategies in this regard, thanks for sharing.

    ReplyDelete

Powered by Blogger.