Code block type

Read(209) Label: code block type,

Description:

Code block type

Syntax:

==x

Calculation block; will be passed after the calculation finishes

>>x

Executable block; will be passed after the execution finishes

//x

Comment block; will be skipped

??

Under the current environment, calculate all cells in order (except the current cell) in the code block in which the current cell is the master cell, and return the result of calculating the last cell

Example:

  Calculation cell:

 

A

B

 

1

==demo.query(

"select NAME as CITY,

The code block is made up of A1, B1 and B2; the string in the master cell begins with ==

2

 

STATEID as STATE from CITIES")

The program will calculate the code block with cell A1 being the master cell as a whole statement, instead of splitting it up

After executing the statement according to the esProc rule, the progam will skip the rest of the cells in the code block

 

Executable cell:

 

A

B

 

1

=connect("demo")

 

 

2

>>A1.execute(

"update DEPARTMENT set MANAGER=? where DEPT='Sales'",

The executable cell is made up of A2, B2 and B3, and returns no result

3

 

"7")

 

Comment cell:

 

A

B

 

1

//comment

1.note...

The comment cell covers a stretch of cells A1-B4; will be skipped in execution

2

 

2.note...

3

 

3.note...

4

 

=1+1

5

=1+1

 

The result is 2

 

The usage of double question marks ??:

 

A

B

C

 

1

[59,164,50,104,93]

 

 

 

2

==A1.(??)

=if(

~>300:"Hazardous",

This is a code block with A2 being the master cell; its value is:

3

 

 

~>200:"Very Unhealthy",

4

 

 

~>150:"Unhealthy",

5

 

 

~>100:"Unhealthy for Sensitive Groups",

6

 

 

~>50:"Moderate",

7

 

 

"Good")