try

Read(2377) Label: try, code block,

Description:

Try to continue with the execution of a code block by ignoring the error.

Syntax:

try

Note:

The statement tries to continue with the execution of a code block. The value of cell holding the try statement becomes null if the code block is correctly executed. And error information will be entered to the try cell and logged when an exception occurs, and the execution goes on. The program may terminate if the statement isn’t used.

Example:

 

A

B

C

D

 

1

try

 

 

 

Use try statement to try to go on with the execution of the code block.

2

 

[1,2,3,4,5]

=[]

 

C2 returns a sequence of [1,2].

3

 

for B2

 

 

 

4

 

 

if B3>2

 

 

5

 

 

 

>C2=C2+B3

The program reports an error at D5, enters the error information in A1, logs it and goes on with the execution.

6

 

 

else

 

 

7

 

 

 

>C2=C2|B3