source:
CIVL/examples/specialStatements/when3.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 291 bytes | |
| Rev | Line | |
|---|---|---|
| [f654c25] | 1 | #include<civlc.cvh> |
| 2 | ||
| 3 | int main(){ | |
| 4 | int a=100, b=1; | |
| 5 | ||
| 6 | $when(a>10){ | |
| [1e89eb7] | 7 | $choose{ |
| 8 | $when(b>0){ | |
| 9 | a=a+1; | |
| 10 | $assert(a==101); | |
| 11 | int a=10; | |
| 12 | $assert(a==10); | |
| 13 | } | |
| 14 | $when(a<200){ | |
| 15 | $when(b>0){ | |
| 16 | a=a+1; | |
| 17 | } | |
| 18 | $assert(a==101); | |
| 19 | int a=10; | |
| 20 | $when(a==10){ | |
| 21 | $assert(b==1); | |
| 22 | } | |
| 23 | } | |
| 24 | } | |
| [f654c25] | 25 | } |
| 26 | } |
Note:
See TracBrowser
for help on using the repository browser.
