Skip to content

Latest commit

 

History

History
55 lines (47 loc) · 726 Bytes

try.md

File metadata and controls

55 lines (47 loc) · 726 Bytes

try, break and continue

  • try keyword is a do version made for loops, allowing you to execute more code at once. break and continue are 2 famous concepts of breaking the loop, and skipping the continuous iteration.
try
{
	console.println.log("Try works!")
	break
}
if.equ,1,1->while.equ,1,1->


new.int,fortestagainomg=0

try
{
	if.equ,fortestagainomg,5->continue
	else->if.equ,fortestagainomg,8->break
	else->do
	{
		console.cout(fortestagainomg)
	}
}
for.int,fortestagainomg,10->

try
{
	if.equ,fortestagainomg,15->break
	console.cout(fortestagainomg)
	fortestagainomg=fortestagainomg+1
}
while.notequ,fortestagainomg,20->

Output:

Try works!
1
2
3
4
6
7
8
8
9
10
11
12
13
14
15