Ver código fonte

Updates docs/EXPRESSION.md

Auto commit by GitBook Editor
master
高杰 7 anos atrás
pai
commit
5b2a046b5c
  1. 8
      docs/EXPRESSION.md

8
docs/EXPRESSION.md

@ -43,3 +43,11 @@ The syntactic structure of if expression in UReport2 is shown in the figure belo
![](/docs/images/ifexpr.png)According to the figure, if judgement expression consists of the part of if conditional judgement, the judgement with several alternative elseif conditions and finally the part of alternative else conditions. The syntactic structure is similar to java or javascript.
| Examples of if judgement expression | Note |
| :--- | :--- |
| if\(A1>1000\){return "normal value"} | Judge whether the value of cell A1 is greater than 1,000. If yes, return to the string of “normal value”; and if no, do nothing. |
| if\(A1>1000\){return "normal value"}else{“low value";} | Judge whether the value of cell A1 is greater than 1,000. If yes, return to the string of “normal value”, otherwise return to the string of “low value”. It shall be noted that in if expression, several options of the keyword of return are available. Adding ';’at the end of the row also indicates it is elective. This design is provided mainly to match the habits in java and javascript program. |
| if\(A1>1000 and A1<20000\){ return "normal value:"+A1}else if\(A>20000 and A1<40000\){ return "High value" }else if\(A>20000 and A1<40000\){ return "ultra-high value"}else{ “low value"} | In this case, several combined conditions are added in the part of conditions, and elseif demands multiple judgements. |

Carregando…
Cancelar
Salvar