feature #6 - preliminary implementation, cannot nest yet
[svn/Cll1h/.git] / demos / exceptions / exceptions.c
CommitLineData
7e4d7575 1#include "cll1.h"
2
3void pokus(int i)
4{
5 if(i==2)
6 {
7 fail(666);
8 }
9 if(i==7)
10 {
11 pokus(2);
12 }
13 if(i==6)
14 {
15 fail(0);
16 }
17 printf("nuda #%d\n",i);
18}
19
20program
21{
22 try
23 {
24 pokus(1);
25 pokus(2);
26 pokus(6);
27 pokus(7);
28 }
29 else_switch_exceptions
30 {
31 case 666: puts("chyba 666"); break;
32 default : puts("sorry, vole, error!");
33 }
34
35 try
36 {
37 pokus(1);
38 pokus(3);
39 pokus(6);
40 pokus(2);
41 pokus(7);
42 }
43 else_switch_exceptions
44 {
45 case 666: puts("chyba 666"); break;
46 default : puts("sorry, vole, error!");
47 }
48
49 try
50 {
51 pokus(1);
52 pokus(7);
53 }
54 else_catch_exception(666)
55 {
56 puts("tak, a basta.");
57 }
58}
This page took 0.166452 seconds and 4 git commands to generate.