source: CIVL/examples/languageFeatures/choose.cvl@ 7a7bed3

1.23 2.0 main test-branch
Last change on this file since 7a7bed3 was 36b5ada, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

Cleaned up examples.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@424 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 256 bytes
RevLine 
[36b5ada]1/* Commandline execution:
2 * civl verify choose.cvl
3 * */
[f28d814]4#include<civlc.h>
[34760dc]5
[28d30e8]6int n = 2;
[34760dc]7float x;
8
9void main() {
10l1:
[f28d814]11 $choose {
12 $when (n>2) { x=2; goto l2; }
13 $when (n>1) { x=1; goto l2; }
[34760dc]14 default: {x=0; goto l2; }
15 }
16l2: ;
[36b5ada]17#assert x == 1;
[34760dc]18}
[59b5362]19
Note: See TracBrowser for help on using the repository browser.